In short
SAMEPERIODLASTYEAR only goes back a year. Last month, last quarter, two years ago, next month: DATEADD handles them all with one number and one unit.
DATEADD shifts dates by a number of days, months, quarters or years, which makes it more flexible than SAMEPERIODLASTYEAR for previous-month or previous-quarter comparisons.

Think of it like this
Sliding along the railway track
Your toy train sits on a section of track marked July. Push it back one section and it's on June. Push it back three and it's on April. Push it forward and it's on August. DATEADD slides the selected dates along the calendar by however many steps you say, in days, months, quarters or years.
Watch it happen
Shifting the context with DATEADD
1/5The visual row is July.
The big ideas
What you need to know
Number and unit
DATEADD ( dates, number, interval ). Negative goes back, positive goes forward. Interval is DAY, MONTH, QUARTER or YEAR.
Shifts the whole range
Whatever dates are in context move together, so it works on days, months and quarters alike.
Same as SPLY for -1 YEAR
DATEADD ( 'Date'[Date], -1, YEAR ) gives the same result as SAMEPERIODLASTYEAR.
Edges of the table
Shifting past the first or last date in your date table returns nothing, so the measure goes blank.
See it in code
Walk through the code
1Sales PM =2CALCULATE ( [Total Sales], DATEADD ( 'Date'[Date], -1, MONTH ) )3 4Sales PQ =5CALCULATE ( [Total Sales], DATEADD ( 'Date'[Date], -1, QUARTER ) )6 7Sales 2Y Ago =8CALCULATE ( [Total Sales], DATEADD ( 'Date'[Date], -2, YEAR ) )9 10Sales Next Month =11CALCULATE ( [Total Sales], DATEADD ( 'Date'[Date], 1, MONTH ) )1/4One month back. The basis for month-over-month comparisons.
Previous month, previous quarter, two years ago and next month from one function.
Save yourself the pain
Common mistakes
Oops
Using DATEADD on Sales[OrderDate].
Do this instead
Use 'Date'[Date]. Gaps in the fact column make the shifted range incomplete.
Oops
Expecting DATEADD ( ..., -30, DAY ) to equal last month.
Do this instead
Months have 28 to 31 days. Use -1, MONTH for month comparisons.
Your mission
Four shifts, one table
Quick check
Which expression returns last quarter's sales?
Go deeper
- 1Create Sales PM using DATEADD with -1 and MONTH.
- 2Create Sales PQ with -1 and QUARTER.
- 3Compare DATEADD with -1 YEAR against SAMEPERIODLASTYEAR.
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.