Forum Discussion
Custom Column on Week
- 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
Chanleakna123 , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
refer if these can help
Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482
Week That Resets Yearly
https://community.powerbi.com/t5/Community-Blog/Week-That-Resets-Yearly-Decoding-Date-and-Calendar-3-5-Power-BI/ba-p/1187502
hi amitchandak
https://www.dropbox.com/s/flw231yuqes4048/445%20Calendar.pbix?dl=0
above is 445 Calendar , as i have Own calendar , though all Calendar based on the calculation , those turn out right .
But because in Year 2021 is different i have the issue with Week 1 :
****i wanna set a condition , If year 2021 , the day start from 01/01/2021 to 01/08/2021 - Will be in Week 1 , and then all the date are running in following that Week 1 , Week 2 , Week 3 etc...