SAMEPERIODLASTYEAR Function
Description:
The SAMEPERIODLASTYEAR function returns a set of dates in the current selection shifted one year back in time.
Return Value:
SAMEPERIODLASTYEAR returns a table with a single column of date values.
Syntax:
SAMEPERIODLASTYEAR( <dates> )
- Description of the parameter:
PARAMETER |
DESCRIPTION |
---|---|
dates |
Column containing dates or a table expression that returns a single column of date/time values |
Example:
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])
)
Related Video: