Monday, December 22, 2014

Creating YTD Calculation in SSRS

Recently I wrote on a method to create YTD calculations using MDX without making modification to the SSAS cube. However, there will often be scenarios where you need an YTD calculation and you are not using a cube as a data source. In these cases you are at the mercy of making an YTD calculation using SQL. For those that have done this before, you know how difficult that can be and how much code you have to write to get that working.
You can creating this using a combination of a Tablix, Matrix, or a Chart object. The required SSRS Expression needed is RUNNINGVALUE. The example of this expression is as follows…

= RunningValue(Fields!Total_Cost.Value,Sum,"Chart3")
Here is an example of using RunningValue to accumulate YTD values…
 
  Using this example, I specific the following formula in the Tablix for the YTD…
 
 The same could be done for SSRS Matrix and Chart objects as well.

1 comment:

Unknown said...

thanks for sharing information,nice article
MSBI Training In Hyderabad