DAX Calendar Table (Date Dimension) Measure

Generates a continuous calendar as a calculated table, with year, month and quarter columns already added.

Dates and CalendarIntermediatecalendardate tablecalculated table

DAX code

Calendar =
ADDCOLUMNS(
    CALENDAR(DATE(2020, 1, 1), DATE(2029, 12, 31)),
    "Year", YEAR([Date]),
    "MonthNumber", MONTH([Date]),
    "MonthName", FORMAT([Date], "MMMM"),
    "Quarter", "Q" & FORMAT([Date], "Q"),
    "YearMonth", FORMAT([Date], "YYYY-MM")
)

Generate a Power BI date table

Notes

This is a calculated table, not a measure - paste it as a new table, extend the date range to cover your data, then mark it as the model's date table.

Requirements

How to use this measure

  1. In Power BI Desktop, select the table that should hold the measure and choose New measure on the ribbon.
  2. Paste the code, then replace the placeholder table and column names with your own. The My table names fields above do this for you.
  3. Run it through the DAX Formatter if you want it laid out in your team's style.

Related DAX measures

More DAX resources

Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Calendar Table (Date Dimension).