March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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 }:->
Solved! Go to Solution.
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.
I have voted, please follow this link:
Microsoft Idea · Date.WeekOfYear enhancement: covering more use cases (powerbi.com)
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
|
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 |
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!
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.
(irrelevant&removed)
antoineL did you created a post in Power BI Ideas? I would vote for it.
Can you post the link?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.