title: Summing a column of expressions in SSRS
body: <p>The detail row in my table contains a column with an expression:</p>
  <pre><code>=sum(Fields!one.Value) / sum(Fields!two.Value)
  </code></pre>
  <p>I want to sum that column, but the results I get are not the sum of the ratios, but the ratio of the sums.</p>
  <p><strong>For example:</strong></p>
  <pre>
       sum(Fields!one.Value)  sum(Fields!two.Value)    ratio
                3                      6                0.5 
                3                      6                0.5 
  total:        6                     12                0.5
  </pre>
  <p>I want the <strong>bottom right corner</strong> value to be the <strong>sum of the values</strong> above it (i.e. <code>1.0</code>), not the ratio of the values to the left of it. I've tried calculating the sum as:</p>
  <pre><code>sum( sum(Fields!one.Value) / sum(Fields!two.Value) )
  </code></pre>
  <p>but that gives the <strong><code>0.5</code></strong>.</p>
  <p>Anyone have any ideas?</p>
  <hr />
  <p><strong>My Solution:</strong></p>
  <p>I added another column to the right of the ratio column and set its visibility to &quot;not visible&quot;. In the detail row, I added this expression:</p>
  <pre><code>=runningValue( sum(Fields!one.Value) / sum(Fields!two.Value), Sum, &quot;table1_grp&quot;)
  </code></pre>
  <p>(<code>table1_grp</code> is in internal group).</p>
  <p>I copied the value from the <code>runningValue</code> textbox in the ratio column in the total row.</p>
  <p><strong>The expression is:</strong></p>
  <pre><code>=ReportItems!Textbox55.Value  
  </code></pre>
  <p>So, the running sum is invisible in the table, but I use the final value in the total row.</p>
  <hr />
  <p>UPDATE:</p>
  <p>My colleague came up with an elegant solution.</p>
  <p>In ratio total box, use the following expression:</p>
  <pre><code>=sum( sum(Fields!one.Value, &quot;table1_grp&quot;) / sum(Fields!two.Value, &quot;table1_grp&quot;) )  
  </code></pre>
  <p>adding the scope to the inner sums does the trick.</p>