Antoine Leca on 02 Feb 2021 17:24:23
Date.WeekOfYear (PowerQuery) give us in Europe wrong results this year (2021), it constantly gives week number that are off by 1. The "European" (really ISO8601) rules are different from the ones in use in the United States of America, and state that week 1 in any year is the one with 4 or more days (in other words, it includes January 4th), not just the week which January 1st as it currently assumes.
Also in this system any week of 7 days has the same number, without regard to the month or the year limits (and there are no week 54 or week 0).
It seems to me there is a missing optional parameter in the Date.WeekOfYear() 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 computation, 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 expected result of 52 or 53 when the date is Saturday January 1st }:->
Administrator on 15 Aug 2024 18:39:41
Update 8/15/2024: Moved from Power BI ideas to Data Factory ideas.
- Comments (1)
RE: Date.WeekOfYear enhancement: covering more use cases
See also: https://ideas.powerbi.com/ideas/idea/?ideaid=d54ffcf6-b7a1-eb11-89ee-281878de0321