Forum Discussion
afk
8 years agoAdvocate II
Week number with 2 digits
Hi, The weeknum formula returns the weeks 1 to 9 as single digits. Is there a way to display these as 2 digits, e.g. 01, 02....09? Thanks!
- 8 years ago
Looks like I've managed to solve this myself :smileyhappy:
I used the DAX Formula " weeknumber = FORMAT(WEEKNUM([date],1),"00") "
If anyone has any other better solutions, please feel free to contribute.
Anonymous
2 years agoNot applicable
If you are doing it in Power Query - M Code then this is what I would use:
if Date.WeekOfYear([DATE]) < 10 then "0" & Number.ToText(Date.WeekOfYear([DATE])) else Number.ToText(Date.WeekOfYear([DATE]))