This article explains how to use SAMEPERIODLASTYEAR function in SSRS to achieve the same result as like in Power BI.
The challenging part is we don’t have SAMEPERIODLASTYEAR function in SSRS so we need to look for another function which should give the same result.
We have “Previous” function in SSRS, we are going to use that function to achieve the result. Let us get started.
First, let see the result of Power BI – SAMEPERIODLASTYEAR
SAMEPERIODLASTYEAR = CALCULATE(sum(DemoSales[Sales]),
Let us replicate the same result in SSRS.
First, understand the functionality of “Previous” function.
It will give the result of the previous row as the line below.
We need to tune the previous function to get the result as same as SAMEPERIODLASTYEAR in Power BI.
Follow the below steps.
The result of the previous function will work only on the current data displayed. For example, if you create a parameter for year and filter for the year 2019 then it will not show any value for previous value.