How to Create Calendar Table using DAX in PowerBI | MI Tutorials

preview_player
Показать описание
How to Create Calendar Table using DAX in PowerBI | MI Tutorials

Calendar =
VAR Days = CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2018, 12, 31 ) )
RETURN ADDCOLUMNS (
Days,
"Year", YEAR ( [Date] ),
"Month Number", MONTH ( [Date] ),
"Month", FORMAT ( [Date], "mmmm" ),
"Year Month Number", YEAR ( [Date] ) * 12 + MONTH ( [Date] ) - 1,
"Year Month", FORMAT ( [Date], "mmm yy" ),
"Week Number", WEEKNUM ( [Date] ),
"Week Number and Year", "W" & WEEKNUM ( [Date] ) & " " & YEAR ( [Date] ),
"WeekYearNumber", YEAR ( [Date] ) & 100 + WEEKNUM ( [Date] ),
"Is Working Day",not WEEKDAY([Date]) in {1,7}
)

Рекомендации по теме
Комментарии
Автор

Please create video with good video quality

Himanshu.bhardwaj
Автор

Thanks for this. I wanna ask cos I have a situation where my company uses an abnormal calendar system;

Week starts on Saturdays, march, June, Sept and December has 5 weeks while the other months have 4 weeks. How do I create a calendar table with these parameters?

emmanuelenumah
Автор

Good info but can you tell me what is the advantage of using the date table separately?

rajsam
Автор

How can I have STARTOFYEAR function in this code?

YTTV-gycs
Автор

Hi, my question would be, in my sales table, i dont have a date column, only a quater and year column, How can i create a column in the sales table that has a date i can then create a relationship with in the date table i have now made? Thank you!

TashaCafasso
Автор

Hi Sir how can we show variance between two dates selected in slicer

dhruvkapoor
Автор

I want my value in monthly basis from jan to Dec

_vibhavsingh
Автор

Couldn't see any thing. Zoom in when you demonstrate. Also your months were in alphabetical order, which is wrong!

deshn