Date dimension
Why a date dimension is different from a sales date
A date dimension describes every day, even when no transaction occurred. A sales table describes events; it may repeat dates and omit quiet days. Classic time intelligence needs a dedicated, contiguous date column with one nonblank value per day. Use the isolated Import model in labs/date-time-intelligence/README.md. It has a single active one-to-many relationship from Dates[Date] to Sales[SaleDate], single-direction filtering, no RLS, en-US formula separators, USD whole-dollar amounts and a certified synthetic data cutoff of February 15, 2025. Native Desktop/DAX results are predicted, not executed. Each named measure is created separately. Do not use the auto date hierarchy. The lab uses complete Gregorian years 2023–2026, with a July–June fiscal year named by its ending year. Edge fiscal years are not complete in this table; only complete covered windows are assessed.
Example 1 — Create the calendar
Create this calculated table in the local model (or import the supplied dates.csv instead, never both).
Dates = CALENDAR(DATE(2023, 1, 1), DATE(2026, 12, 31))Expect 1,461 rows, including February 29, 2024. Set Date to date type, mark Dates as the date table using Date, and relate it to Sales[SaleDate]. Test uniqueness, no gaps, no nulls and fact-date coverage before calculating revenue. CALENDARAUTO(6) instead derives a range from eligible dates in the model and rounds to fiscal year boundaries; unrelated date fields may extend it, so inspect the bounds. DATE constructs dates; validate incoming components because out-of-range month/day values may roll into other dates.
Example 2 — Build sortable fiscal attributes
Create these calculated columns individually.
Year = YEAR(Dates[Date])MonthNumber = MONTH(Dates[Date])MonthLabel = FORMAT(Dates[Date], "MMM yyyy", "en-US")MonthKey = YEAR(Dates[Date]) * 100 + MONTH(Dates[Date])FiscalYear = YEAR(Dates[Date]) + IF(MONTH(Dates[Date]) >= 7, 1, 0)FiscalMonth = MOD(MONTH(Dates[Date]) + 5, 12) + 1These are separate column definitions, not one DAX query. Sort MonthLabel by MonthKey. June 30, 2024 belongs to FY2024 month 12, July 1 to FY2025 month 1, and February 15, 2025 to FY2025 month 8. MonthNumber alone is suitable for month-of-year labels, not cross-year month labels.
Avoid hidden and ambiguous calendars
Disable auto date/time for this isolated file if enabled. A hidden date hierarchy is convenient for a quick single-table report but can lead to multiple separate calendars. Use the explicit date dimension for shared filtering. Normalize timestamps to the agreed business date upstream; dropping time before adjusting the timezone can put transactions on the wrong date. A date table spanning future days does not prove that sales are available for those days.
Practice — Audit a calendar
Without Power BI, inspect dates.csv. Check the leap day, unique day grain and range. Derive fiscal year and month for June 30 and July 1, 2025. Explain how to sort month-year text across years. In a disposable Desktop model, optionally verify these facts; record the build and actual result separately.
Further official reading
Microsoft Learn: model date tables
These links provide supporting context; the local fixture and its expected results remain unchanged.