Back to Roadmap
Level 4 — Time Intelligence+75 XP
Lesson 2

2. SAMEPERIODLASTYEAR

Compare any period to the identical timeframe one year prior.

The Concept

SAMEPERIODLASTYEAR shifts the current filter dates back by exactly one year.
Example DAX:
Sales Last Year = 
CALCULATE(
    [Total Revenue],
    SAMEPERIODLASTYEAR('Date'[Date])
)

Whether the user views a day, month, quarter, or year, SAMEPERIODLASTYEAR automatically shifts that exact time duration back 365/366 days.

Try It Yourself

Calculate Prior Year Sales using CALCULATE, [Total Revenue], and SAMEPERIODLASTYEAR(Date[Date]).

fx
[fx]SAMEPERIODLASTYEAR=
Loading DAX Formula Studio...
Type [ for fields