title: error : nested aggregation that specifies a dataset scope
body: <p>I have been working on ssrs and tried to do the following statement. I am using data from 2 datasets and there is no way I can merge them into one (I tried that when I first had this error). Code:</p>
  
  <pre><code>=Sum(iif(Fields!Year.Value = Max(Fields!Year.Value) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0))
  </code></pre>
  
  <p>This code gives the error: <code>The Value expression for the text box has a nested aggregate that specifies a dataset scope. Inner aggregates cannot specify a dataset scope.</code></p>
  
  <p>I have also tried a different variation of this code which is as follows:</p>
  
  <pre><code>=(iif(Fields!Year.Value = Max(Fields!Year.Value) - 1 , Sum(Fields!PersonCount.Value, "RetCust"), 0))
  </code></pre>
  
  <p>I just got rid of the sum at the beginning. But this time I had a different error: <code>Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case</code></p>
  
  <p>Hope someone can help :)</p>
  
  <p>Cheers</p>