Ravi Chandu Edru/ videos

Tiny Fixes · 4 of 10

Why is my Power BI last year blank? SAMEPERIODLASTYEAR fix

Oct 24, 2026 · 1:00 · Short

In this video

Your last-year measure, CALCULATE([Total Sales], SAMEPERIODLASTYEAR(Sales[OrderDate])), shows blank in every month, and the formula looks right.

Why: the measure moves the dates in the Sales table back one year, but the month on each row comes from your Date table, and that month filter still reaches Sales. A row would have to be in this month and last year at the same time, so nothing matches. (In my test the total row, which has no month filter, did show a number: 10,800.)

The fix, recorded live in Power BI Desktop: point the measure at your marked Date table.

Sales PY = CALCULATE([Total Sales], SAMEPERIODLASTYEAR('Date'[Date]))

Press Enter and every month fills in.

No Date table yet? Build one with every day from the first date to the last (no gaps), mark it as the date table (right-click the table, Mark as date table) and relate it to Sales. Heads up: marking it removes Power BI's automatic date tables, so check older visuals that used them.

Newer option: calendar-based time intelligence (preview) doesn't need a gap-free table. Microsoft now recommends it; it's still in preview.

Docs:
Implement time-based calculations: learn.microsoft.com/power-bi/transform-model/desktop-time-intelligence

Set and use date tables: learn.microsoft.com/power-bi/transform-model/desktop-date-tables

SAMEPERIODLASTYEAR: learn.microsoft.com/dax/sameperiodlastyear-function-dax

Read the transcript

Press a time to play from there.

Your last-year sales are blank. Every month. And the formula looks right. Here's why. Your measure moves the dates in the Sales table back one year. But the Date table's month filter still reaches Sales, and it stays. This month and last year at the same time?

Nothing matches. The fix: use your marked Date table instead. Change Sales[OrderDate] to 'Date'[Date], the Date table's Date column. Press Enter, and every month fills in. No Date table yet? Build one with every day from the first to the last, no gaps. Mark it as the date table and relate it to Sales.

Heads up: marking it removes the automatic date tables, so check your older visuals. With classic time intelligence, last year needs a complete, marked Date table. Found this useful? Hit like and subscribe for more fixes that save your reports. See you in the next one!