title: Change values in a query with vba filters
body: <p>I have multiple vba filters I need to apply to my sql query. Column yellow is the column I want to alter with filters. I have more filters but this is the outline. Column roi has to change every time new average is applied to column yellow. Because formula for roi is</p>
  <p><code>ROUND(((col_az*0.7-1.4-6-5-yellow) / NULLIF((yellow),0)*100),0)</code></p>
  <ul>
  <li><p>Apply filter to f_n_s = 'yes' and roi &lt; 10</p>
  </li>
  <li><p>Every visible row in yellow must have the formula AVERAGE(max1,max2)</p>
  </li>
  <li><p>Every visible row in yellow must have the formula AVERAGE(max1,max2,max3)</p>
  </li>
  <li><p>Every visible row in yellow must be max5</p>
  <pre><code>SELECT *,
      CASE
          WHEN f_n_s IN ('yes') AND roi &lt; 10 THEN ROUND(((max1+max2)/2),2)
      END as yellow
  FROM
  
  [Subqueries]
  </code></pre>
  </li>
  </ul>
  <p>This is what I do but I can't add the other filters. I don't even know if it's doable.</p>