Forum Discussion
NPC
Helper I
4 years agoCustom Weeknum
Hello, I'm trying to create a column with custom week numbers (Operating periods) that end in the dates below: 1/1/2022 - 1/12/2022 - Week 1 1/13/2022 - 1/19/2022 - Week 2 1/20/2022 - 1/2...
- 4 years ago
Hi NPC
Create a new column with below DAX
Column = var __days = DATEDIFF("2022-1-5",Dates[Date],DAY) var __customWeekNum = IF(__days>0,ROUNDUP(__days/7,0),1) return "Week " & __customWeekNumBest Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
v-jingzhang
Community Support
4 years agoHi NPC
Create a new column with below DAX
Column =
var __days = DATEDIFF("2022-1-5",Dates[Date],DAY)
var __customWeekNum = IF(__days>0,ROUNDUP(__days/7,0),1)
return
"Week " & __customWeekNum
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
- NPC4 years ago
Helper I
This works. Thank you!