Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kjssdca
Regular Visitor

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?

 

WEEKNUM every 10th week.PNG

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@kjssdca ,

Do not use format in that column. You only need Weeknum([Date],1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@kjssdca ,

Do not use format in that column. You only need Weeknum([Date],1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Okay, removing FORMAT worked - Thanks @amitchandak !

WEEKNUM every 10th week - fixed (no FORMAT).PNG

@kjssdca , Please mark the solution

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
camargos88
Community Champion
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


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.