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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
StefanBosman
Regular Visitor

Calender table with Date.WeekOfYear = week 53

Hi all,

 

I am struggeling with my Calender Table in Power Query editor. I have been using my Calender table for over a year now, but since the year 2021 my WeekOfYear is off. On the 1st of January it starting counting from week 1 again. This results in Monday the 4th of January being the start of week 2. This is incorrect! Does anyone know how to solve this?

 

In Power Query editor I added the column like this:

= Table.AddColumn(#"Added Custom CurWeekOffset", "Week van jaar", each Date.WeekOfYear([Date]), Int64.Type)

 

My dates look like this:

StefanBosman_0-1610524744904.png

 

Obviously, December 28th till January 3rd should be week 53 and January 4th should be the start of week 1.

 

Thank you in advance!

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

@StefanBosman 

Check this out

https://community.powerbi.com/t5/Desktop/Incorrect-week-number-at-year-end-beginning/m-p/1474033

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 

 

SU18_powerbi_badge

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Hi Stefan, 

 

I used 

Week= WEEKNUM ('Date', 21)

 

It works for me.

AlB
Community Champion
Community Champion

@vdE 

I do not understand the question. Can you share a sample pbix including the M code where you show what you want do and explain what doesn't work?

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 

 

SU18_powerbi_badge

vdE
Regular Visitor

I can give you the formules for week 53 at the beginning of 2021.

But then we have a other problem:

If you select year & week, 1 January 2021 falls in week 53-2021.

That is incorrect.

 

Does someone know a solution for this?

 

vdE_0-1611083157761.png

 

Hi @vdE ,

 

I haven't thought of that. I always use my Week No. and Year columns seperate from each other. I also do not have a solution for your challenge. 

AlB
Community Champion
Community Champion

@StefanBosman 

Check this out

https://community.powerbi.com/t5/Desktop/Incorrect-week-number-at-year-end-beginning/m-p/1474033

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 

 

SU18_powerbi_badge

Hi @AlB ,

 

Thanks! Had a hard time implementing the solution, but is working!

 

Strange that Power Query does not support ISO week numbers...

Anonymous
Not applicable

Hi @StefanBosman 

 

May I ask how you solved it? I am having the same issue.

Hi @Anonymous ,

 

I have used the query's from @AilleryO in the mentioned post and updated them to fit my Calender table in Power Query.

AlB
Community Champion
Community Champion

Hi @StefanBosman 

Is the "problem" only in 2021? If you want a quick and dirty solution, just assign a 53 if the day is <= than 3rd Jan and subtract one for the other days in the year, either in that same column or in a separate one

 

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 

 

SU18_powerbi_badge

 

Hi @AlB ,

 

Thank you for your reply. However, I would like a permanent solution, so this would not happen again.

 

What query should I insert instead of the Date.WeekOfYear([Date])?

 

Thank you.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.