ravi326's avatar
ravi326
Icon for Helper I rankHelper I
7 days ago

Power BI last year compares the wrong weekday? (Tiny Fix 8)

If your last-year measure uses SAMEPERIODLASTYEAR on a date column, Power BI compares each day with the same date last year, not the same weekday. 7 March 2026 is a Saturday, but 7 March 2025 was a Friday, so every day is compared with the wrong weekday.

The recommended way is calendar-based time intelligence (preview). A calendar compares by week, so the Saturday of week 10 meets last year's week 10 Saturday:

  1. File, Options and settings, Options, Preview features: select Enhanced DAX Time Intelligence, then restart Power BI Desktop.
  2. In the Data pane, right-click your Date table, then Calendar options, New calendar.
  3. Year = Week Year, Week = Week, Date = Date. Validate data, then Save and close.
  4. Point every last-year measure at the calendar: SAMEPERIODLASTYEAR ( 'Retail weeks' )

Check: before, Saturday +127% and Monday -50%. After, every day lands between +7% and +15%, and the bars line up.

Trap from my test: start the date table on the Monday that begins week 1 (30 Dec 2024 for 2025). Mine started on 1 January and every comparison slipped by two days. Calendars don't work with live connected or composite models yet.

Microsoft Learn: https://learn.microsoft.com/power-bi/transform-model/desktop-time-intelligence

No RepliesBe the first to reply