Though you can create the date table in any view, switching to the data view would make it easier for you to track any changes to your table.
To change the view, click the table icon on the left side pane:
To add a new date table, go to the ‘Modeling’ tab and click ‘New Table’ from the ribbon:
Now that you have a new table, you would want to name it and use the ‘CALENDAR’ function to define the date range you would like your table to have.
To make the purpose of this table clear, let’s name it “Date Table”:
As you can see, after writing ‘CALENDAR’, Power BI will give you a hint on how to finish the expression similar to how Excel does it.
For example, the retail analysis sample already has a date range in a table labeled “Time”.
Upon close examination, you can see that the column labeled “Month” contains data about the day, month, and year.
To define the table, all you have to do is reference the table and column of your existing data.
Date Table = CALENDAR(FIRSTDATE(Date formatted column),LASTDATE(Date formatted column))
With the Retail Analysis Sample, the expression becomes:
Date Table = CALENDAR(FIRSTDATE('Time'[Month]),LASTDATE('Time'[Month]))
Now you’ve got a date table based on your existing dataset:
Congratulations! You just made your first date table in Power BI! 🎉