Forum Discussion
WEEKNUM - Every 10th week is 6 digits
Created a Dates table that includes a column for Week Number using DAX WEEKNUM function. Most of the data is correct, however for some reason every 10th week is showing up as 6-digit numbers that increment for each day of that week. This is the case for week numbers 10, 20, 30, 40 and 50. In example below, 143527 is Sunday, 143528 is Monday, etc. of week number 10. I tried changing data format for Week column from Text to Whole Number and even deleted and re-created the table, but still having the issue. Does anyone know how to fix this?
kjssdca ,
Do not use format in that column. You only need Weeknum([Date],1)
4 Replies
- camargos88
Community Champion
Hi kjssdca ,
Try this code:
D = ADDCOLUMNS(CALENDAR(TODAY()-180; TODAY()); "Year"; FORMAT([Date]; "yyyy"); "Month"; FORMAT([Date]; "mmm"); "Week"; WEEKNUM([Date]; 1))I reproduced your code and I think the weeknum function inside function makes the return wrong. Try this code without format the week.Ricardo - amitchandak
Super User
kjssdca ,
Do not use format in that column. You only need Weeknum([Date],1)
- kjssdcaRegular Visitor
Okay, removing FORMAT worked - Thanks amitchandak !
- amitchandak
Super User
kjssdca , Please mark the solution