Tiny Fixes · 8 of 10
Power BI last year: wrong weekday? Use calendar time intelligence
In this video
Saturday up 127% on last year? Before you celebrate, check which day it's being compared with.
Why: SAMEPERIODLASTYEAR on your date column compares the same date last year, not the same weekday. 7 March 2026 is a Saturday, but 7 March 2025 was a Friday. So this year's Saturday is compared with last year's Friday, Sunday with Saturday and Monday with Sunday: a busy weekend day against a steady weekday. If you plan staff or stock from it, every day is judged against the wrong day.
The better way: calendar-based time intelligence. It's still a preview, but it's now the recommended way (docs below). Try it on a copy of your report first. A calendar compares by week, so the Saturday of this year's 10th week meets the Saturday of last year's 10th week. Your date table needs two columns for it: Week Year (the year each week belongs to) and Week (such as 2026-W10).
No Week Year column yet? Add these three calculated columns (not measures): select your Date table, then Table tools, New column, and paste one formula each time. ISO weeks, Monday to Sunday:
Week Year = YEAR ( 'Date'[Date] + 4 - WEEKDAY ( 'Date'[Date], 2 ) )
Week of Year = WEEKNUM ( 'Date'[Date], 21 )
Week = 'Date'[Week Year] & "-W" & FORMAT ( 'Date'[Week of Year], "00" )The fix, in 4 steps:
- Switch on the preview: File, Options and settings, Options. Under Preview features, select Enhanced DAX Time Intelligence. Click OK, restart Power BI Desktop and reopen your file.
- In the Data pane, right-click your Date table and pick Calendar options. Click New calendar and name it (mine: Retail weeks).
- Year: pick Week Year. Add category, Week: pick Week. Add category, Date: pick Date. Then Validate data, Save and close, Done.
Associated columns: if your visuals or filters use another column for the week, such as a label "Week 10, 2026", pick it in Select associated columns on the Week row. In my test, a visual by that label showed a BLANK last year without it, and the right number with it. Visuals that use Week itself work either way. - A calendar only changes the measures that use it. In your Sales last year measure, replace 'Date'[Date] with the calendar's name, and do the same for every measure that compares with last year:
Sales last year = CALCULATE ( [Sales], SAMEPERIODLASTYEAR ( 'Retail weeks' ) )
How it works: the calendar tells Power BI which column is the year, the week and the date, so "same period last year" goes back one week year, to the same week and the same weekday.
Check it: before, Saturday +127%, Sunday -27%, Monday -50%. After, every day meets its own weekday: Saturday +15%, every day between +7% and +15%.
Tip from my test: start the date table on the Monday that begins a week year (week year 2025 starts on Mon 30 Dec 2024). Mine started on 1 January and every comparison slipped by two days.
How to check yours: open Table view, pick your Date table and sort Date from oldest to newest. The first row should be a Monday with Week of Year = 1. If it isn't, move the start of your date table back to that Monday (for example CALENDAR ( DATE ( 2024, 12, 30 ), DATE ( 2026, 12, 31 ) ) if your table uses CALENDAR).
No previews allowed at work? CALCULATE ( [Sales], DATEADD ( 'Date'[Date], -364, DAY ) ) also keeps the weekday, but it drifts over time, because a year is 365 or 366 days, not exactly 52 weeks.
Good to know before you switch: it's a preview; calendars don't work with live connected or composite models; don't combine custom calendars with auto date/time tables; calendars can't be authored in the Power BI service yet.
Docs:
Time intelligence and calendars (preview): learn.microsoft.com/power-bi/transform-model/desktop-time-intelligence
SAMEPERIODLASTYEAR: learn.microsoft.com/dax/sameperiodlastyear-function-dax
DATEADD: learn.microsoft.com/dax/dateadd-function-dax
Read the transcript
Your report says Saturday sales are up 127% on last year. But it may be comparing the wrong days. In the next few minutes: why it happens, the new fix, and how to check the result. Let's start the episode. Here's why. SAMEPERIODLASTYEAR compares the same date last year, not the same weekday.
7 March 2026 is a Saturday, but 7 March 2025 was a Friday. So this year's Saturday is compared with last year's Friday, Sunday with Saturday, and Monday with Sunday. That's the wrong comparison: a busy weekend day against a steady weekday. If you plan staff or stock from it, you're judging each day against the wrong day last year.
So how can we fix it? There's a better way now: calendar-based time intelligence. It's still in preview, but it's now the recommended way. Because it's a preview, try it on a copy of your report first. A calendar compares by week: the Saturday of this year's 10th week with the Saturday of last year's 10th week.
Your date table needs two columns for it: Week Year, the year each week belongs to, and Week, such as 2026-W10. For example, 30 December 2024 already belongs to week 1 of 2025. If you don't have them yet, add these three as calculated columns: columns Power BI fills in from a formula, one value for every date. They're not measures.
Select your Date table, click Table tools, then New column, and paste each formula. They're all in the description. Now the fix, in four steps. Step 1. Switch on the preview: it's off until you turn it on. Click File, Options and settings, Options. Under Preview features, select Enhanced DAX Time Intelligence.
Click OK, save your file, restart Power BI Desktop and reopen it. Step 2. In the Data pane, right-click your Date table and pick Calendar options. Click New calendar and name it. Mine is Retail weeks. Step 3. Fill in three categories. Type the name in each search box to find it fast.
Year: pick Week Year. Click Add category, choose Week, then pick your Week column. If your visuals use another week column, such as a label 'Week 10, 2026', pick it in Select associated columns on the Week row. In my test, without it, Sales last year by that label came out blank.
If you don't use one, skip this. Add category again, choose Date, pick Date. Then Validate data, Save and close, and Done. What the calendar does: it tells Power BI which column is the year, the week and the date. So last year means one week year back: the same week, the same weekday.
Step 4. A calendar only changes the measures that use it. Click your Sales last year measure. In the formula, replace 'Date'[Date] with the calendar's name, 'Retail weeks', and press Enter. Do the same for every measure that compares with last year. Now check it. Before: Saturday +127%, Sunday -27%, Monday -50%.
After: every day meets its own weekday. Saturday +15%, and every day between +7% and +15%. Saturday is now compared with Saturday, and in my report the big swings are gone. Here's a tip from my test: start your date table on the Monday that begins a week year.
Mine started on 1 January, and every comparison slipped by two days. So remember: by date, last year lands on a different weekday. By week, it lands on the same one. Found this useful? Hit like and subscribe for more fixes for the newest Power BI features.
See you in the next one!