Forum Discussion
Adding Weeknum on the Calendar Table provided by Avi Singh
- 1 year ago
Hello Mramono
Your issue:
Right now, WeekSequenceNum starts counting from April (your Calendar start), so 1st April is Week 1. But you want 1st April to be Week 14 (since weeks should start from January).In your M Query, right at the end step, add this line:
#"Inserted WeekNum_StartingMonday" = Table.AddColumn(#"Changed Type1", "WeekNum", each Date.WeekOfYear([Date], Day.Monday), Int64.Type)
in
#"Inserted WeekNum_StartingMonday"This new WeekNum column will:
Always start counting weeks from 1st January,
Use Monday as the first day of the week,
And correctly give you 1st April 2025 = Week 14.
I believe there is also a Week of Year column in your table, which is working fine and starts from 14. If you want, you can use that column also, if not you can use the above solution
- 1 year ago
try this
Date.WeekOfYear([Date],1)
try this
Date.WeekOfYear([Date],1)