Forum Discussion
Function Calendar Wrong WeekNum
- 5 years ago
Anonymous , Try these column and see if last column give you desired output
Create a week start date
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 //Monday
or
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],1)+1 //Sunday
Week Year = year([Week Start date])
First Week start of year = minx(filter('Date', [Week Year] =earlier([Week Year])),[Week Start date])
Week of Year = Quotient( datediff([First Week start of year],[Date],Day),7)+1
- 5 years ago
You should use WEEKNUM ( 'Date'[Date], 21 )
Returntype 21 = ISO 8601 Week or the European weeknumbering system, no need for custom formulas or functions.
You could also read more about the Weeknum function here: WEEKNUM – DAX Guide
hi Michelle, did you get the solution for your problem? i too face the same issue. Wk52 2021 has to show last 4 days of Dec '21 and first 3 days of Jan'22. but it shows first days of Jan'21. Pls share solution if you found one.