title: Conditional formatting on expression with IIF statement - SSRS 2008 R2
body: <p>I am trying to apply condition formatting on an SSRS expression that is already using an IIF statement in order to return it's value correctly.  Is this possible?  </p>
  
  <p><strong>The expression:</strong></p>
  
  <pre><code>=SUM(IIf(RIGHT(Fields!Category.Value, 2) = "01", CDBl(Fields!Cost.Value), CDBL(0)))
  </code></pre>
  
  <p>The below switch is what I would like to use in order to apply a red/green background accordingly in the fill property, but I am not sure how to do so because I need to first evaluate the IIF in order to know the value to base the color upon.  Any ideas?</p>
  
  <p><strong>The switch:</strong> </p>
  
  <pre><code>=Switch( 
  (
  Fields!Cost.Value &lt;= .8944), "Red", 
  Fields!Cost.Value &gt; 1.0945), "Red", 
  1=1, "Green" 
  ) 
  </code></pre>
  
  <p>Ideally I would rework my stored procedure/groupings so that the IIF was not needed here and I could just do the conditional formatting on Fields!Cost.Value, but that is not possible given the quick turnaround needed here.</p>