Search code examples
ssrs-2008ssrs-2012

SSRS - Calculation expression from two different Dataset


I have a report that has 2 dataset (Dataset1 and Dateset2) both have the same fields. How can I calculate the difference between DataSet1 - Opted In and Dataset 2 - Opted in?

For example: Dataset 1 - Opted In has 5000; Dataset 2 - Opted In has 10000, in the Opted difference column it should provide 5000 difference.

I tried the expression below, but it is not providing the difference result.

=Join(Lookup(Fields!Month.Value, Fields!Month.Value,(ReportItems!OptedIn3.Value)-(ReportItems!OptedIn4.Value),"THOR_Monthly"))

enter image description here


Solution

  • You can use the query

    =Fields!OptedIn.Value-Lookup(Fields!Month.Value,Fields!Month.Value,Fields!OptedIn.Value,"DataSet1")
    

    change the name of the fields if it is different in your tables