My week runs Saturday to Friday,
is there a way in dax i can get the week no and year? as currently i only have the option in dax for Sunday to monday
I hope it helps you:
You can do the SWITCH function like below:
Weekday = SWITCH( TRUE();
"Saturday"; 0 ; "Sunday"; 1 ; ...;
"Friday"; 6 )
I hope it helps you.
thanks for your reply, here is an example of what i need
i have a date column ie 2018-02-16
and i need another column with the week number. My week no should be 7 as i use saturday as frist day of the week but dax will return me 6
You can include one column with weekday_name, then to do the SWITCH function based on the weekday_name.
You can use below formula to get Week Number from Saturday to Friday.
Calculate column formula:
VAR _calendar =
ADDCOLUMNS ( 'Calendar', "WeekDay", WEEKDAY ( [Date], 1 ) ),
YEAR ( [Date] ) = YEAR ( EARLIER ( [Date] ) )
FILTER ( _calendar, [Date] <= EARLIER ( [Date] ) && [WeekDay] = 7 )
Check out a full recap of the month!
Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.