Building a Date Table in Power BI
Create a proper Date dimension table — required for all time intelligence calculations
A Date table is the single most important dimension table in any Power BI model that involves dates. Without it, time intelligence functions like TOTALYTD and SAMEPERIODLASTYEAR will not work correctly.
Requirements for a Date table:
• One row per day — no gaps, no duplicates
• Covers the full date range of your data (at minimum)
• Contains a Date column with Date data type
• Must be marked as the Date Table in Power BI
You can create a Date table in three ways: using DAX (CALENDAR function), Power Query (M code), or loading from an external source. DAX is the most common approach.
Example
Key Points
- ✓CALENDARAUTO() auto-detects the date range from your model — great for dynamic reports
- ✓Always add Year, Month, Quarter columns — these power your axis drill-down hierarchies
- ✓Sort Month Name by Month Number: select Month column → Column Tools → Sort by Column → Month No
- ✓Mark as Date Table disables Power BI's auto date hierarchy — your custom hierarchy takes over
- ✓Connect Date[Date] to every fact table date column via a relationship
Practice Question
After creating a Date table with CALENDAR(), what must you do before time intelligence DAX functions will work correctly?