I am working on a SSRS report and I am trying to create an expression to sum the results of the same column in two different datasets (DataSet1 and DataSet2). This is based on the Activity column value being "C" in DataSet1.
=sum(iif(Fields!ActivitySort.Value = "C","DataSet1"),sum(Fields!CumulativeCapitalInvested.Value,"DataSet1")+sum(Fields!CumulativeCapitalInvested.Value,"DataSet2"),0))
I have rewritten the expression a number of times but I cannot get it right.
Error I get with above expression:
The Value expression for the textrun ‘Textbox195.Paragraphs.TextRuns’ has a scope parameter that is not valid for an aggregate function. The scope parameter must be set to a string constant that is equal to either the name of a containing group, the name of a containing data region, or the name of a dataset.
Would someone be able to help me with this expression?