Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
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
Hi @Kbrennan856,
You can use below formula to get Week Number from Saturday to Friday.
Calculate column formula:
weeknum = VAR _calendar = FILTER ( ADDCOLUMNS ( 'Calendar', "WeekDay", WEEKDAY ( [Date], 1 ) ), YEAR ( [Date] ) = YEAR ( EARLIER ( [Date] ) ) ) RETURN COUNTROWS ( FILTER ( _calendar, [Date] <= EARLIER ( [Date] ) && [WeekDay] = 7 ) ) + 1
Regards,
Xiaoxin Sheng
Hi,
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
Hi,
You can include one column with weekday_name, then to do the SWITCH function based on the weekday_name.
I hope it helps you.
Best regards,
Hi @Kbrennan856,
You can do the SWITCH function like below:
Weekday =
SWITCH(
TRUE();
"Saturday"; 0 ;
"Sunday"; 1 ;
...;
"Friday"; 6 )
I hope it helps you.
Best regards,
Hi @Kbrennan856,
I hope it helps you:
https://msdn.microsoft.com/en-us/library/mt260707.aspx
Thanks,
Ricardo
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
122 | |
80 | |
47 | |
44 | |
35 |
User | Count |
---|---|
182 | |
83 | |
70 | |
47 | |
45 |