Year over year, year to date and month to date all fail the same way without a proper date table: blank results, or numbers that look plausible but are wrong. One table of dates, marked correctly and related to the fact table, fixes all of them at once.
| Date | key |
| Year | 2024 |
| Quarter | Q3 |
| Month | Sep |
| MonthNumber | 9 |
| IsWeekend | FALSE |
SAMEPERIODLASTYEAR needs a column of dates with no gaps. A fact-table date column only contains dates that had sales, so the function has nothing to shift.
Sorting a text month name alphabetically gives April, August, December. A MonthNumber column plus "Sort by column" fixes the axis.
Months with no sales disappear from the axis instead of showing zero, so trends and averages are misread.
Modeling → New table. Cover every date in the data plus the full current year, so future months exist as empty rows.
DimDate =
ADDCOLUMNS(
CALENDAR( DATE( 2022, 1, 1 ), DATE( 2026, 12, 31 ) ),
"Year", YEAR( [Date] ),
"Quarter", "Q" & QUARTER( [Date] ),
"MonthNumber", MONTH( [Date] ),
"Month", FORMAT( [Date], "mmm" ),
"IsWeekend", WEEKDAY( [Date], 2 ) > 5
)
Prefer loading it from Power Query if you want fiscal years, holidays or a custom week start — the same idea, built as a list of dates and expanded with columns.
Model view → right-click DimDate → Mark as date table → choose the Date column. Without this flag, time intelligence functions either return blanks or silently use the wrong column.
Drag DimDate[Date] onto the fact table's date column. The relationship must be one-to-many (date on the one side) and single direction. If your fact table stores a key like 20260915, add that same key to DimDate and relate on it instead.
Select the Month column → Column tools → Sort by column → MonthNumber. Charts then read January to December rather than alphabetically.
Hide the fact table's date column. If a visual uses the fact date and a measure uses DimDate, filters split and the numbers disagree with each other.
Sales YTD = TOTALYTD( [Total sales], 'DimDate'[Date] ) Sales YoY % = VAR Current = [Total sales] VAR Prior = CALCULATE( [Total sales], SAMEPERIODLASTYEAR( 'DimDate'[Date] ) ) RETURN DIVIDE( Current - Prior, Prior ) Sales MTD = TOTALMTD( [Total sales], 'DimDate'[Date] )
Each one assumes a single, continuous, marked date table. Get that right once and every time-based measure in the model inherits it.
| Problem | Symptom | Fix |
|---|---|---|
| Gaps in the dates | YTD resets, YoY blank for some months | Build with CALENDAR, never from DISTINCT of fact dates |
| Duplicate dates | Relationship becomes many-to-many, totals double | Remove duplicates; the date column must be unique |
| Date + time in the key | Relationship fails or filters miss | Strip the time component, or join on the date part |
| Table not marked | Time intelligence returns blank or wrong values | Mark as date table and point at the Date column |
| Two date tables | Inconsistent results between visuals | Keep one date table; model extra roles as separate relationships + inactive ones |
Turn it off. It creates a hidden date table per date column, bloats the model and behaves inconsistently with your own measures. One explicit date table is simpler and smaller.
To the end of the current year at minimum, plus any forecast horizon you report on. Past dates should start at the earliest date in the data.
If the business reports on a non-calendar year, add FiscalYear and FiscalMonth columns to the same table and sort month names by the fiscal order.
Keep it as a relationship key and hide it. Every visual and measure should use the date table's columns.
Yes, but the date table should be imported (a calculated table or a small Power Query table) so the engine can filter it locally.
Sales, orders, average order value, year over year, share of total and running total — with the filter context explained.
If the model is still one flat table, start there: the date table is one of its five steps.