Date Table Generator

Pick your options, copy the code, paste it into Power BI.

DAX calculated table

Preview

Preview of the first and last rows.

Why can't AI do this?

AI can write a date table, but the code can change slightly each time you ask, and small details like fiscal year names, week numbers and leap years are easy to get wrong without any warning. This generator gives you the same result every time, shows you the actual rows before you copy anything, and runs entirely in your browser, so your table names and settings are never sent anywhere. Pick your options, check the preview, copy the code, and paste it into Power BI.

How to use this generator

No installs or sign-up needed.

  1. Choose DAX or Power Query M above the code box.
  2. Set the table name and the date range. Use Fixed years, or Based on my data if you chose DAX.
  3. Set your fiscal year start, week start and weekend days, and tick the column groups you want.
  4. Check the preview table, then click Copy (or Download).
  5. Follow the steps in the "After you paste it" box. Your settings are remembered on this device for next time.

Frequently asked questions

Is it free and private?

Yes. The generator runs entirely in your browser. Nothing you type or choose is sent to a server. Only your settings are remembered, on your own device.

DAX or Power Query M, which should I pick?

Both give you the same columns. A DAX table is created inside the model and is rebuilt on every refresh. It can also follow the dates in your data. A Power Query M table loads like any other query, and is the better choice if you want to reuse the date table in other tools like dataflows. Power Query M can't read your model, so it only supports Fixed years.

How does the fiscal year setting work?

You choose the month the fiscal year starts, and whether it is named after the year it ends or the year it starts. With a July start named after the end year, July 2024 to June 2025 is FY2025. Named after the start year, the same period is FY2024. Fiscal Month Number counts from 1 at your start month, and Fiscal Quarter groups those months in threes. With a January start, the fiscal year is just the calendar year.

What is an ISO week, and why can ISO Year differ from Year?

ISO weeks follow the international standard: weeks start on Monday, and week 1 is the week with the year's first Thursday. Because of that, the first days of January can belong to the last week of the previous year (for example, 1 January 2021 is week 53 of 2020), and the last days of December can belong to week 1 of the next year. ISO Year tells you which year the ISO week belongs to. These two columns ignore the "Week starts on" setting.

Why do I need Sort by column?

Power BI sorts text alphabetically, so months would appear as April, August, December. Setting Month Name to sort by Month Number fixes the order. Do the same for Day Name with Day of Week Number, Year Month with Year Month Number, and Fiscal Quarter Label with Fiscal Quarter.

Why do the "Relative to today" columns only change after a refresh?

They are calculated when the table is built, using that day's date. They stay the same until your data refreshes, and then they move forward to the new date.

Can I get month and day names in other languages?

Not yet. Names are always in English, so they don't change with the language of the computer that opens the report.

What is the largest range allowed?

Years from 1990 to 2100, with at most 60 years in one table. With Based on my data you can also add up to 5 extra years after your latest date.