Creating Calendar Table in Power BI

- Saturday, January 02, 2021

You can generate a date table in your model by creating a calculated table using either the CALENDAR or CALENDARAUTO DAX functions. Power BI Calendar Table with Weeks, Month, & Year. Creating the Date Dimension in Power BI.

 Creating Calendar Table in Power BI

Creating Calendar Table in Power BI


  Calendar = 
VAR BaseCalendar = 
	CALENDAR ( DATE ( 2018, 8, 1 ), DATE ( 2020, 12, 31 ) )
RETURN    
	GENERATE (
		BaseCalendar,
		VAR BaseDate = [Date]
		VAR YearDate = YEAR (BaseDate)
		VAR MonthNumber = MONTH (BaseDate)
		VAR WeekNumber = WEEKNUM (BaseDate)
		VAR WeekDay = WEEKDAY (BaseDate)
	RETURN ROW (
		"Day", BaseDate,
		"Month", FORMAT (BaseDate, "mmmm"),
		"Month Number", MonthNumber,
		"Year", YearDate,
		"Year Month", FORMAT ( BaseDate, "yy/mm" ),
		"Week Number", WeekNumber,
		"Week Day", FORMAT(BaseDate, "DDDD"),
		"Weekday Number", WEEKDAY(BaseDate, 2)
	)
)

Joydeep Deb

Marketing . Innovation . Technology

Share:

About the Author
Joydeep Deb

Joydeep Deb is a Senior Digital Marketer and Project Manager with strong experience in Digital Marketing, Lead Generation, Online Brand Management, Marketing Campaigns, Project Management, Search Engine Optimization (SEO), Search Engine Marketing (SEM), PPC, eMail Marketing, Web Analytics, Web Technologies, Web Design and Development.

With an MBA in Marketing. IIM Calcutta Alumini. Lives in Bangalore, Karnataka - India.

Get social with Joydeep at Twitter | Facebook | LinkedIn

Subscribe to Newsletter

Receive my latest posts right in your inbox? Enter your email address below to subscribe.

We'll never share your email with anyone else.