Create a Quick Date Table in Power BI

In this post I’ll show you how to quickly create a date table in Power BI. To do this you’ll need the below DAX and your Power BI report.

In your Power BI report go to Modelling in the ribbon and select New Table.

In the DAX editor paste the below date code and hit enter.
You can edit the date range to suit your needs.


Date = 
ADDCOLUMNS (
	CALENDAR(DATE(2018,1,1), DATE(2030,12,31)),
	"Year", YEAR( [Date] ),
	"Month No", FORMAT( [Date], "MM" ),
	"Year Month No", FORMAT( [Date], "YYYY-MM" ),
	"Year Month", FORMAT( [Date], "YYYY-mmm" ),
	"Month Name Short", FORMAT( [Date], "mmm" ),
	"Month Name Long", FORMAT( [Date], "mmmm" ),
	"Day Of Week No", WEEKDAY( [Date] ),
	"Day Of Week", FORMAT( [Date], "dddd" ),
	"Day Of Week Short", FORMAT( [Date], "ddd" ),
    "Quarter No",FORMAT( [Date], "q" ),
	"Quarter", "Q" & FORMAT( [Date], "Q" ),
	"Year Quarter", FORMAT( [Date], "YYYY" ) & "-Q" & FORMAT ( [Date], "Q" )
	)

This will create a calculated table named Date that looks like below.

You can now amend the columns such as the date format, and order names by numbers.

Enjoy!