title: SSRS Total of IIF with SUM
body: <p>I have two column groups, they have their individual row totals, calculated by</p>
  
  <pre><code>Sum(Fields!ColumnGroup1.Value)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Sum(Fields!ColumnGroup2.Value)
  </code></pre>
  
  <p>I then have a column that shows the difference between the two sums, but only if their total difference is bigger than 0</p>
  
  <pre><code>=IIF(
       Sum(Fields!ColumnGroup1.Value) - Sum(Fields!ColumnGroup2.Value) &gt; 0.00,
       Sum(Fields!ColumnGroup1.Value) - Sum(Fields!ColumnGroup2.Value), 
       0.00)
  </code></pre>
  
  <p>Now the row contains my two column groups, their totals and their differences if it is bigger than 0</p>
  
  <p>How do I calculate the sum of all the rows for the expression column ?</p>
  
  <p>For some reasons the following gives me incorrect values:</p>
  
  <pre><code>=SUM (
       IIF(
           Sum(Fields!ColumnGroup1.Value) - Sum(Fields!ColumnGroup2.Value) &gt; 0.00,
           Sum(Fields!ColumnGroup1.Value) - Sum(Fields!ColumnGroup2.Value), 
       0.00)
       )
  </code></pre>
  
  <p>Is that suppose to work ?</p>
  
  <p>Thanks!</p>