A date table that actually works.
Contiguous dates, no gaps, a real sort column for every month label, ISO week numbers, and fiscal year handled properly. Pick your range and copy the DAX or the Power Query code.
After you paste it
- Mark it as a date table. Table tools →
Mark as date table → choose the
Datecolumn. Time intelligence will not behave without this. - Set the sort columns. Select
Month→ Sort by column →Month Number. Same forYear Month→Year Month Sort, andMonth Short→Month Number. - Hide the raw keys. Hide
Month Number,Year Month Sort,Quarter NumberandFiscal Month Numberfrom the report view. - Relate it. Create a one-to-many relationship from
DimDate[Date]to every fact table’s date column. - Never filter it. Filtering or slicing the date table itself breaks time intelligence. Slice the fact table instead.
The date table is step one.
The free Time Intelligence Starter Pack adds twelve measures on top of it — YTD, QTD, YoY, rolling windows — each one explaining the trap it avoids.
DAX table or Power Query table — which should I use?
Power Query if the table is large, if you want it to refresh with the rest of the model, or if you need to join holidays and working-day flags later. DAX if you want zero extra queries and the model is already small. Both produce the same structure here, so switching later costs nothing.
Why is the range always whole years?
Partial years create gaps at the edges and make DATEADD /
SAMEPERIODLASTYEAR behave inconsistently. A whole-year
range costs a few hundred rows and removes a whole class of bugs.
Why do month names sort alphabetically in my visuals?
Because a text column sorts by text. Set Sort by column on
Month to Month Number, and on
Year Month to Year Month Sort. The generator
already includes both columns for exactly this reason.
Does Power BI’s automatic date table do the same thing?
It creates hidden tables per date column, which works well enough to hide the problem until you add a second fact table or a fiscal calendar. An explicit table you control is the version that survives those changes — and it is the only one you can mark and relate deliberately.