title: SSRS sum max by group
body: <p>I have an SSRS report that looks like this (with additional columns such as sales) with rows grouped by region and location.</p>
  
  <p><img src="https://i.stack.imgur.com/JpHbX.png" alt="SSRS report"></p>
  
  <p>The goal for the locations is the max for each location as in my query the goal appears on each sales record that I'm summing.</p>
  
  <pre><code>=Max(Fields!goal.Value)
  </code></pre>
  
  <p>The goal for the regions is the sum of the max for each location in that region group.</p>
  
  <pre><code>=Sum(max(Fields!goal.Value, "LocationName"), "region")
  </code></pre>
  
  <p>Those first two are no problem, but I'm having difficulty getting the grand total for the report which would be the sum of each region total. </p>
  
  <pre><code>=Sum(Fields!goal.Value, "region")
  </code></pre>
  
  <p>I can't reference the region group as the total is outside that group - "scope parameter that is not valid for an aggregate function". How do I get the sum of each region (7,000) in this instance?</p>