title: SSRS Dynamic Background Color based on data in Dynamic columns
body: <p>I have a report with two columns.  These two columns are named either "This Month" or "Last Month".  I am trying to add a background color to the data cells in "This Month" in relation to the data in "Last Month".</p>
  
  <p>I am familiar with dynamic color coding using an IIF statement, but cannot seem to figure this out.</p>
  
  <p>Below, I am trying to use an IIF with a LOOKUP command, but I am not sure if I am even using this command correctly.  Any help would be appreciated.</p>
  
  <pre><code>=IIF(LOOKUP(Fields!Type.Value = "This Month", Fields!Type.Value, Fields!Count.Value, "ExecutiveFCAPS") &lt; LOOKUP(
  Fields!Type.Value = "Last Month", Fields!Type.Value, Fields!Count.Value, "ExecutiveFCAPS"), "LightGreen", 
  
  IIF(LOOKUP(Fields!Type.Value = "This Month", Fields!Type.Value, Fields!Count.Value, "ExecutiveFCAPS") = LOOKUP(
  Fields!Type.Value = "Last Month", Fields!Type.Value, Fields!Count.Value, "ExecutiveFCAPS"), "Yellow", 
  
  IIF(LOOKUP(Fields!Type.Value = "This Month", Fields!Type.Value, Fields!Count.Value, "ExecutiveFCAPS") &gt; LOOKUP(
  Fields!Type.Value = "Last Month", Fields!Type.Value, Fields!Count.Value, "ExecutiveFCAPS"), "Orange", "Transparent")))
  </code></pre>