Year-to-date last year: combining time functions
Compare this year’s running total with last year’s running total at the same point in the calendar.
You will learn to
- Apply a date shift to an existing time measure
- Explain how CALCULATE layers date filters
- Build a like-for-like YTD comparison
How it works
“Are we ahead of last year?” is best answered with running totals: this year’s YTD against last year’s YTD **at the same point**. By the end of May 2025 you want January to May 2025 next to January to May 2024.
You already have `[Sales YTD]`. Wrap it in `CALCULATE` with `SAMEPERIODLASTYEAR('Date'[Date])`. CALCULATE first shifts the visible dates back a year; then `[Sales YTD]` runs inside that shifted context and totals from the start of that earlier year.
This is the real power of time intelligence: measures are building blocks. A date shift applied to a measure that already contains a date calculation stacks the two.
Practice it hands-on with a real data model and a live report that updates as you type.
Sales QTD LY = CALCULATE([Sales QTD], SAMEPERIODLASTYEAR('Date'[Date]))