Prior-year comparisons often wrap this inside CALCULATE: it takes whatever dates are currently filtered and moves them twelve months earlier, matching DATEADD with -1 YEAR.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains SAMEPERIODLASTYEAR in context, with comparison tables and the common traps.
Terms in this definition
- CALCULATE
A DAX function that computes an expression after changing the filter context with filter modifiers, Boolean filters or table filters. Called with no filters, it still turns any row context into filter context, which is known as context transition.
- EARLIER
Within nested DAX row contexts, lets an inner calculation read a column as it stood in an outer pass; EARLIEST jumps to the outermost. Most people now use variables, which read more clearly.
- DATEADD
Shifts the set of dates in the current filter context by a given number of years, quarters, months or days, earlier or later. Prior-year comparisons are a typical use of this DAX time intelligence function.
Related terms
- Time intelligence
Covers DAX functions (TOTALYTD, DATEADD, SAMEPERIODLASTYEAR and others) that shift or accumulate filtered dates. Classic versions require a contiguous, marked date table; calendar-based versions, still in preview, rely on defined calendars.