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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
antoineL
Frequent Visitor

Date.WeekOfYear

Important notice: I am living in Europe, not in the US.

 

I am having wrong results with Date.WeekOfYear: this year (2021), it constantly shows me week number that are off by 1. That is, for a source date which is Monday January 25th, it returns 5 when it should be 4: week 1 starts on 1/4 (if a Monday), week 2 starts on 1/11, week 3 starts on 1/18. As you might know, week numbers are important in some industries.

 

It seems to me there is a missing optional parameter in that function which should be probably the minimum number of days in the first week of the year, this parameter would default to 1 which is the current computed value (US standard? Excel/1-2-3 inherited?) but ought to be set to 4 when using the European (or Industrial, or ISO) standard.

Then the programmers at Microsoft would fine tune the code to achieve the result of 52 or 53 when the date is Saturday January 1st }:->

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @antoineL ,

 

Thanks for your suggestion! Please post your idea on Power BI Ideas.

It is a place for customers to provide feedback about Power BI.

What's more, if a feedback is highly voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

View solution in original post

6 REPLIES 6
KlasJohansson
Regular Visitor

AlB
Super User
Super User

@antoineL 

These solved something similar:

https://community.powerbi.com/t5/Desktop/how-to-adjust-week-number-in-date-dale/m-p/1598957#M647578

https://community.powerbi.com/t5/Power-Query/Calender-table-with-Date-WeekOfYear-week-53/m-p/1597115

 

SU18_powerbi_badge

Please accept the solution 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

 

antoineL
Frequent Visitor

Sorry I did not myself clear enough. I am not asking you how to solve that problem using custom function (which have already been written many times, although there are pitfalls). What I am pointing at is that the stock Date.WeekOfYear() function should probably be improved to be able to compute the ISO/European week number. Indeed, both threads you quoted were started because the original poster blindly assumed it would be the case.

 

For the benefit of people reading this thread in search of the problem you are tackling, the links you gave are leading to https://community.powerbi.com/t5/Desktop/Incorrect-week-number-at-year-end-beginning/m-p/1474322#M61... which IMHO is a good solution (albeit I did not measure its performance impact). But such a solution ought to be temporary!

Icey
Community Support
Community Support

Hi @antoineL ,

 

Thanks for your suggestion! Please post your idea on Power BI Ideas.

It is a place for customers to provide feedback about Power BI.

What's more, if a feedback is highly voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

antoineL
Frequent Visitor

(irrelevant&removed)

Anonymous
Not applicable

antoineL did you created a post in Power BI Ideas? I would vote for it.

Can you post the link?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors