Calendar Tabele

Very simple but useful Calendar table for Power Bi

Calendar = 
	ADDCOLUMNS(
		CALENDARAUTO() /*CALENDAR(date(startyear,1,1),date(endyear,12,31))*/
		,"Day Name",FORMAT([Date],"DDDD")
		,"Day of Week",(WEEKDAY([Date],1))
		,"Day of Month",DAY([Date]) 
		,"Week",DATE(YEAR([Date]),MONTH([Date]),DAY([Date]))-(WEEKDAY([Date],1)-1)
		,"Week Name", "Week of " & DATE(YEAR([Date]),MONTH([Date]),DAY([Date]))-(WEEKDAY([Date],1)-1)
		,"Week of Year", WEEKNUM([Date],1)
		,"Month", DATE(YEAR([Date]),MONTH([Date]),1)
		,"Month Name", FORMAT([Date],"MMMM")
		,"Month of Year", MONTH([Date])
		,"Month Year Name", FORMAT([Date],"MMM") & " " & YEAR([Date])
		,"Month Year Name Sort",(100*YEAR([Date])+MONTH([Date]))
		,"Quarter",DATE(YEAR([Date]),SWITCH(ROUNDUP(DIVIDE(MONTH([Date]),3,1),0),1,1,2,4,3,7,4,10),1)
		,"Quarter Name", "Q" & ROUNDUP(MONTH([Date])/3,0)
		,"Quarter Year Name", "Q" & ROUNDUP(MONTH([Date])/3,0) & " " & YEAR([Date])
		,"Year", DATE(YEAR([Date]),1,1)
		,"Year #",YEAR([Date]))

Leave a Reply

Your email address will not be published. Required fields are marked *