In short
A number alone means little. "₹14 lakh in July" becomes a story when you know last July was ₹11 lakh. SAMEPERIODLASTYEAR fetches that comparison for any period you're looking at.
SAMEPERIODLASTYEAR shifts the dates in the current context back one year, so CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) ) gives last year's sales for the same period.

Think of it like this
Last year's festival photo
Every Ganesh Chaturthi your family takes a photo at the same spot. Holding this year's photo next to last year's, you instantly see who grew taller. SAMEPERIODLASTYEAR is that old photo: same spot, same days, exactly one year earlier.
Watch it happen
Shifting the selected dates back one year
1/4The visual row is July 2026, so the filter context holds 1 to 31 July 2026.
The big ideas
What you need to know
Shifts the whole range
Whatever dates are in context, a day, a month, a fiscal year, move back exactly one year.
Used inside CALCULATE
It returns a table of dates, so it's a filter argument: CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) ).
Needs last year in the table
Your date table must cover the previous year too, or the comparison returns blank.
Stacks with YTD
Apply it to a YTD measure to get last year's YTD up to the same point.
See it in code
Walk through the code
1Sales PY =2CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )3 4Sales PY FYTD =5CALCULATE ( [Sales FYTD], SAMEPERIODLASTYEAR ( 'Date'[Date] ) )6 7Sales vs PY =8[Total Sales] - [Sales PY]1/3Same dates, one year back. Works by day, month, quarter or year.
Previous year sales, previous year fiscal YTD, and the rupee difference.
Save yourself the pain
Common mistakes
Oops
Passing Sales[OrderDate] instead of 'Date'[Date].
Do this instead
Always use the date column of your marked date table so every day is available.
Oops
Comparing a partial current month with a full month last year.
Do this instead
If July 2026 has only 12 days of data, compare with the same 12 days, for example by limiting dates to the last sales date.
Your mission
This year vs last year
Quick check
What type of value does SAMEPERIODLASTYEAR return?
Go deeper
- 1Create a Sales PY measure.
- 2Show it next to Total Sales by month in a table.
- 3Check that it still works at quarter and year level.
More topics at this stop
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.