Search code examples
reporting-servicesssrs-2012ssrs-tablix

SSRS add Total row with differences


I want to add a total row in Reporting Services where the difference (in numbers and percent is available). Attached you'll se the current img in SSRS and the requested output in Excel as example.

SSRS

enter image description here

Excel

enter image description here


Solution

  • Supposing you are going to compare only two years you can use this approach.

    To calculate change from one year to the next.

    =Sum(iif(Fields!year.Value= Parameters!Yearfrom.Value,Fields!incurred_losses.Value,0)-
    Sum(iif(Fields!year.Value= Parameters!Yearto.Value,Fields!incurred_losses.Value,0)
    

    For change in percentage:

    =(Sum(iif(Fields!year.Value= Parameters!Yearfrom.Value,Fields!incurred_losses.Value,0)-
    Sum(iif(Fields!year.Value= Parameters!Yearto.Value,Fields!incurred_losses.Value))/
    Sum(iif(Fields!year.Value= Parameters!Yearfrom.Value,Fields!incurred_losses.Value,0)
    

    Use this expression for every column in your tablix.

    Let me know if this helps you.