Forum Discussion
Chanleakna123
5 years agoPost Prodigy
Custom Column on Week
hi all , can anyone help me with the code ? in Year 2021 is the different between the Past Year. as i calculate Week Number I used the Code : if Date.WeekOfYear([Date],6)>52 then 52 else Date.W...
- 5 years ago
Update it as follows:
#"Added Custom1" = Table.AddColumn(#"Sorted Rows", "Week Number", each if Date.WeekOfYear([Date],6)>52 then 52 else if ([Year]=2021 and List.Contains({1,2}, Date.WeekOfYear([Date],6))) then 1 esle if [Year]=2021 then (Date.WeekOfYear([Date],6)-1) else Date.WeekOfYear([Date],6))Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
AlB
5 years agoCommunity Champion
You need to modify this step:
#"Added Custom1" = Table.AddColumn(#"Sorted Rows", "Week Number", each if Date.WeekOfYear([Date],6)>52 then 52
else if ([Year]=2021 and List.Contains({1,2}, Date.WeekOfYear([Date],6))) then 1
else Date.WeekOfYear([Date],6))
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Chanleakna123
5 years agoPost Prodigy
hi AlB amitchandak it's turning to Week 1 , and it should be runs in following Week , by Week 2 and Week 3 Week 4 Week 5.....
because right now it didn't have Week 2 .
Can you help on this .So Excited, We almost there.
thanks you so much