Forum Discussion
Bratone
Helper I
3 years agoIncorrect week number 2021/2022
Hello, I have a problem with the week number, in the transition from 2021 to 2022, I get this: For getting the week number I have followed this formula when adding a custom column, w...
amitchandak
Super User
3 years agoBratone , calculate week year and week number based on week start date , new columns in date table
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 // Monday start
Week Year = year([Week Start Date])
min week start of year = minx(filter('Date',[Year] =earlier([Year])),[Week Start date])
week No = quotient(datediff([min week start of year],[date],day),7)+1
Bratone
Helper I
3 years agoFollowed your formulas and I get the same thing, 1st of Jan is still WK1 (instead of WK53 of 2021) and 2nd of Jan is still WK2.
The only thing that I changed was in the first column, I used:
Week Start Date = 'Calendar'[Date]+-1*WEEKDAY('Calendar'[Date],1)+1
That is because I want the start of week to be on a Sunday, not on a Monday, hence the 1 instead of 2 in the weekday formula.