The SAMEPERIODLASTYEAR function returns a set of dates in the current selection shifted one year back in time.
SAMEPERIODLASTYEAR returns a table with a single column of date values.
SAMEPERIODLASTYEAR( <dates> )
- Description of the parameter:
Column containing dates or a table expression that returns a single column of date/time values
We would like to display in our report, in addition to the sales amount of the selected year, the sales amount of the previous year.
Using the following formula, we can calculate the Sales Amount of the previous year.
PreviousYear SAmount = CALCULATE( SUM(Sales[SalesAmount]), SAMEPERIODLASTYEAR('Calendar'[Date]) )