SAMEPERIODLASTYEARDateDate
SAMEPERIODLASTYEAR is a DAX time intelligence function used in Power BI, SQL Server Analysis Services, and Excel data models. It returns a table of dates that corresponds to the same period in the previous year, based on the dates in the current filter context.
The function is commonly used to enable year-over-year comparisons for measures such as sales, revenue, or units.
Syntax and usage: SAMEPERIODLASTYEAR(<dates>) where <dates> is a date column from a date table or a column
Example: Revenue LY = CALCULATE(SUM(Sales[Revenue]), SAMEPERIODLASTYEAR('Date'[Date]))
This computes total revenue for the same dates in the prior year, relative to the current calendar
Requirements and considerations: A proper, continuous date table is required, and it must be related to the
See also: PARALLELPERIOD, DATEADD, SAMEPERIODLASTMONTH, SAMEPERIODLASTQUARTER.