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
Anonymous
Not applicable

DAX WEEKNUM gives incorrect values since jan 1st 2021

I use this formula in a DAX calulated date table:

"YearWeek", FORMAT ( [Date], "yyyy" ) & " " & FORMAT(WEEKNUM([date],2),"00")

 

This is the result:

mikejarod_0-1609915261940.png

until 31-12-2020 = week 2020 53

from 1-1-2021 until 3-1-2021 = week 2021 01

from 4-1-2021 and further = week 2021 02

 

According to Outlook this is incorrect:

[I pasted a screenshot of the outlook calender here but for some reason it wont show]

Outlook says:

until 31-12-2020 = week 2020 53

from 1-1-2021 until 10-1-2021 = week 2021 01

from 11-1-2021 and further = week 2021 02

 

And according to this site this is also incorrect

https://www.epochconverter.com/weeks/2021

 

I see a few more issues like this on this site, this problem also seems to occur when using the power query weeknum equivalent.

4 REPLIES 4
Anonymous
Not applicable

Thanks. I found this in the documentation:

 

By default, the WEEKNUM function uses a calendar convention in which the week containing January 1 is considered to be the first week of the year. However, the ISO 8601 calendar standard, widely used in Europe, defines the first week as the one with the majority of days (four or more) falling in the new year. This means that for years in which there are three days or less in the first week of January, the WEEKNUM function returns week numbers that are different from the ISO 8601 definition.

 

I live in Europe. So now with this behaviour Power BI will differ from other Microsoft applications and also the European standard. In my opinion this is not acceptable.

@Anonymous , Please log an issue, mentioning "I live in Europe. So now with this behavior Power BI will differ from other Microsoft applications and also the European standard."

https://community.powerbi.com/t5/Issues/idb-p/Issues

 

Please provide a Screenshot from other applications. 

Create a new post mentioning why you have created an issue and ask people to vote.

Anonymous
Not applicable

test. i cannot reply. i get html errors (from the site not the browser) and post flooding errors. this site is really slow btw.

amitchandak
Super User
Super User

@Anonymous , What I see in the screenshot seem correct the way power bi weeknum work. It resets with year.

 

Like if you want week 53 to continue will 3, you can have like this

min week start of year = minx(filter('Date',[Year] =earlier([Year])),[Week Start date])
min week start of year = minx(filter('Date',year([Week Start date])=earlier(year(Week Start date]))),[Week Start date])
week No = quotient(datediff([min week start of year],[date],day),7)+1

 

Or create some logic to get a custom one.

 

One more user pointed out an issue(I think it working as per doc). Check if he logged a issue or idea

https://community.powerbi.com/t5/Issues/idb-p/Issues

https://ideas.powerbi.com/ideas/

 

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.