How does the SAMEPERIODLASTYEAR function (DAX) work?
The SAMEPERIODLASTYEAR function (DAX) returns a table that contains a column of dates shifted one year back in time from the dates in the specified dates column, in the current context.
SAMEPERIODLASTYEAR Formula Syntax
How do you use the SAMEPERIODLASTYEAR function?
The SAMEPERIODLASTYEAR function can be used to declare that the values are moved one year back, based on “Date” column.
Related Blog Posts
Related Support Forum Posts
Considerations when using the SAMEPERIODLASTYEAR function
The dates argument can be any of the following:
- A reference to a date/time column,
- A table expression that returns a single column of date/time values,
- A Boolean expression that defines a single-column table of date/time values.
Related Video Tutorials
Formula examples using the SAMEPERIODLASTYEAR function
= CALCULATE(SUM(‘GA Traffic'[Users]),SAMEPERIODLASTYEAR(‘GA Traffic'[Date]), AllExcept(‘GA Traffic’, ‘GA Traffic'[Date]))
= CALCULATE ( SUM (Sales [Sales Amount]),SAMEPERIODLASTYEAR (Sales [Date]) )
Related DAX Functions
Related Course Modules
To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.