Short answer: a date table has one row per day for whole years, with columns for year, quarter, month, week and fiscal periods, and a relationship to every date in your fact tables. Classic time intelligence (DATESYTD, SAMEPERIODLASTYEAR) needs it: Microsoft lists its rules as unique values, no blanks, and contiguous dates from start to end. Build it with DAX (CALENDAR plus ADDCOLUMNS) or Power Query, mark it as a date table, sort month names by month number, and turn off auto date/time.
Without a date table, Power BI creates a hidden one per date column (auto date/time): the model grows, fiscal years are impossible, and order date and ship date cannot share one slicer.
What does a good date table contain?
| Column | Example | Used for |
|---|---|---|
| Date | 2026-10-29 | the key for relationships |
| Year | 2026 | slicers, axes |
| Quarter | Q4 | axes |
| Year Quarter | 2026 Q4 | axes across years |
| Month Number | 10 | sorting month names |
| Month Name | October | axes, sorted by Month Number |
| Year Month | 2026-10 | continuous month axis |
| Week (ISO) | 44 | weekly reports |
| Weekday | Thursday | patterns by day, sorted by weekday number |
| Fiscal Year | FY2027 | fiscal reports (year starting 1 July) |
| Is Working Day | TRUE | working-day counts |
How do you build it in DAX?
Date =
VAR FirstYear = YEAR ( MIN ( Sales[Order Date] ) )
VAR LastYear = YEAR ( MAX ( Sales[Order Date] ) )
RETURN
ADDCOLUMNS (
CALENDAR ( DATE ( FirstYear, 1, 1 ), DATE ( LastYear, 12, 31 ) ),
"Year", YEAR ( [Date] ),
"Quarter", "Q" & QUARTER ( [Date] ),
"Year Quarter", YEAR ( [Date] ) & " Q" & QUARTER ( [Date] ),
"Month Number", MONTH ( [Date] ),
"Month Name", FORMAT ( [Date], "MMMM" ),
"Year Month", FORMAT ( [Date], "YYYY-MM" ),
"ISO Week", WEEKNUM ( [Date], 21 ),
"Weekday Number", WEEKDAY ( [Date], 2 ),
"Weekday", FORMAT ( [Date], "dddd" ),
"Fiscal Year", "FY" & ( YEAR ( [Date] ) + IF ( MONTH ( [Date] ) >= 7, 1 ) ),
"Is Working Day", WEEKDAY ( [Date], 2 ) <= 5
)Whole years matter: DATESYTD and SAMEPERIODLASTYEAR work on complete years. WEEKNUM ( date, 21 ) returns ISO 8601 weeks (Monday start, week 1 contains the first Thursday). WEEKDAY ( date, 2 ) numbers Monday as 1.
CALENDARAUTO ( ) builds whole years covering all dates in the model, but it also picks up birth dates and far-future dates, so a range from the fact table is safer.
How do you build it in Power Query?
Power Query is better when the table is shared or needs holidays from a source. Microsoft's example starts with:
let
StartDate = #date(2022, 1, 1),
EndDate = #date(2026, 12, 31),
NumberOfDays = Duration.Days(EndDate - StartDate) + 1,
DateList = List.Dates(StartDate, NumberOfDays, #duration(1,0,0,0)),
DateTable = Table.FromList(DateList, Splitter.SplitByNothing(), {"Date"}),
AddYear = Table.AddColumn(DateTable, "Year", each Date.Year([Date]), Int64.Type)
in
AddYearAdd the other columns with Table.AddColumn in the same way, then set the Date column's type to Date.
What do you set in the model?
- Mark as date table: select the table, Table tools, Mark as date table, choose the Date column. Power BI checks the rules.
- Sort by column: Month Name by Month Number, Weekday by Weekday Number, Year Month is already sortable.
- Relationships: Date[Date] one-to-many to each fact date column; one active (order date), others inactive for USERELATIONSHIP.
- Turn off auto date/time: File, Options, Current file, Data load, Auto date/time, and for new files under Global.
- Hide the fact tables' date columns, so everyone slices by the Date table.
What goes wrong?
- Dates with times. A Date/Time column with times does not match the date table's midnight values; convert to Date.
- Gaps. A date table built from distinct order dates has holes, and classic time intelligence throws an error on missing dates.
- Partial years. Starting on the first sale date breaks year-to-date and last-year comparisons at the edges.
- Month names sorted alphabetically. April first; set Sort by column.
- Auto date/time left on. Hidden tables for every date column grow the model.
Where can you check this?
- Microsoft Learn: Set and use date tables in Power BI Desktop
- Microsoft Learn: Implement time-based calculations in Power BI
- Microsoft Learn: Auto date/time guidance
Where do you start?
Build the DAX date table above, mark it, connect it, and turn off auto date/time. Then YTD, QTD and MTD and year over year work with one line each.