Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi guys,
I have a column with DAX use =WEEKNUM([Dates], 21). What i need is the first week of a year will start in first monday. And the DAX works fine for year 2021 and 2022
But in 2020 and beyond. January 1 which is week 1 of the month, not the first Monday. in 2020, week 1 is supposed to start on january 6th but Weeknum in dax counts from the 1st. does anyone know why?
Thank you
Solved! Go to Solution.
@ivanajoh , if that is not as per standard. Then you can log an issue or idea.
or You can develop some custom logic.
like if(year([Date]) =2020 , <> , <> )
The ISO 8601 definition for week 01 of an year is the week with the first Thursday of the year and starts with Monday.
For 2022 and 2021 we see that the week starting from 3rd and 4th January respectively satisfy these conditions.
But for 2020 and 2019
we see that the first Thursday is contained in the week beginning from 1st January. Hence the first week for these years begins from last year December. And 1st January is included in that week 1, hence week 1 for those years begins from 1st January.
For the year 2020⬇️
For the year 2019⬇️
Hence the results you are getting are correct. Hope this helps.
Regards,
Aditya
The ISO 8601 definition for week 01 of an year is the week with the first Thursday of the year and starts with Monday.
For 2022 and 2021 we see that the week starting from 3rd and 4th January respectively satisfy these conditions.
But for 2020 and 2019
we see that the first Thursday is contained in the week beginning from 1st January. Hence the first week for these years begins from last year December. And 1st January is included in that week 1, hence week 1 for those years begins from 1st January.
For the year 2020⬇️
For the year 2019⬇️
Hence the results you are getting are correct. Hope this helps.
Regards,
Aditya
@ivanajoh , if that is not as per standard. Then you can log an issue or idea.
or You can develop some custom logic.
like if(year([Date]) =2020 , <> , <> )
User | Count |
---|---|
47 | |
27 | |
23 | |
18 | |
15 |
User | Count |
---|---|
55 | |
34 | |
18 | |
17 | |
15 |