Forum Discussion
Week number wrong
Hey all,
I have a big problem!
For where I work, the weeks start on a Monday, but as you can see below it's wrong.
For the Wk32 it should show values from the 8th to14th.
The columns Month, week number and date are columns from a calendar table that comes from a database.
When I add, week start date calculated column, it shows the wrong the result as well.
Here is what I'm using for the calculated column.
What do I need to do for my week to show the correct dates?
How can I make sure the week number 01 starts on 3/01/2022?
Thanks very much!
Hi ROG ,
According to your description, the week num of the year should starts at a weekday.
Here's my solution, create a calculated column.
Week Number = WEEKNUM ( [Date], 2 ) - IF ( WEEKDAY ( STARTOFYEAR ( 'Calendar'[Date] ), 2 ) IN { 6, 7 }, 1, 0 )Both the week number and week start date get correct result.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- Greg_DecklerCommunity Champion
ROG WEEKNUM(..., 2) has weeks starting on Monday.
WEEKNUM function (DAX) - DAX | Microsoft Docs
Also WEEKDAY is similar
WEEKDAY function (DAX) - DAX | Microsoft Docs
- v-yanjiang-msftCommunity Support
Hi ROG ,
According to your description, the week num of the year should starts at a weekday.
Here's my solution, create a calculated column.
Week Number = WEEKNUM ( [Date], 2 ) - IF ( WEEKDAY ( STARTOFYEAR ( 'Calendar'[Date] ), 2 ) IN { 6, 7 }, 1, 0 )Both the week number and week start date get correct result.
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.