Calendar Table =
ADDCOLUMNS (
CALENDAR
( DATE ( 2019, 1, 1
), DATE ( 2020, 12, 31 ) ),
"DateAsInteger",
FORMAT ( [Date],
"YYYYMMDD" ),
"Year",
YEAR ( [Date] ),
"Monthnumber",
FORMAT ( [Date],
"MM" ),
"YearMonthnumber",
FORMAT ( [Date],
"YYYY/MM" ),
"YearMonthShort",
FORMAT ( [Date],
"YYYY/mmm" ),
"MonthNameShort",
FORMAT ( [Date],
"mmm" ),
"MonthNameLong",
FORMAT ( [Date],
"mmmm" ),
"DayOfWeekNumber",
WEEKDAY ( [Date]
),
"DayOfWeek",
FORMAT ( [Date],
"dddd" ),
"DayOfWeekShort",
FORMAT ( [Date],
"ddd" ),
"Quarter",
"Q" & FORMAT
( [Date], "Q" ),
"YearQuarter",
FORMAT ( [Date],
"YYYY" ) & "/Q"
& FORMAT
( [Date], "Q" )
)
Here, we passed manual start & end date under Calendar DAX function, as you know Calendar DAX function returns the table with single column name “[Date]”
So, same [Date] column name we will pass in others DAX functions.
We used ADDCOLUMN DAX function to add other columns with date column, like:-
- FORMAT ( [Date], “YYYYMMDD” )
- YEAR ( [Date] )
- FORMAT ( [Date], “MM” ) etc.
Create a Calendar table to using existing dataset date column:
- Change only Start & End date under Calendar Dax.
- Pass MIN date as a Start date & Max date as a End date
Comments
Post a Comment