Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello!
I've used CALENDAR() in a new table and I've obtained a date column, I'd like to calculate a new column with DAX to obtain the week number ( 1 - 54 ), but with the following condition:
1) The first week of the year should be the 1st January for every year.
I've read similar posts and tried to apply and modify the DAX code to acheive that, but I haven't succeed.
Thanks in advance for your help
Solved! Go to Solution.
Hi @ElMeSaFeR ,
How about this:
Here the DAX that was used to create the calculated column:
WeekNumber = ROUNDDOWN ( ( ( RANKX ( FILTER ( 'date', 'date'[Year] = EARLIER ( 'date'[Year] ) ), 'date'[Dates], , ASC , DENSE ) + 6 ) ) / 7, 0 )
Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Hi @ElMeSaFeR ,
How about this:
Here the DAX that was used to create the calculated column:
WeekNumber = ROUNDDOWN ( ( ( RANKX ( FILTER ( 'date', 'date'[Year] = EARLIER ( 'date'[Year] ) ), 'date'[Dates], , ASC , DENSE ) + 6 ) ) / 7, 0 )
Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Excellent, Thanks alot 🙂
User | Count |
---|---|
14 | |
10 | |
7 | |
6 | |
5 |
User | Count |
---|---|
30 | |
19 | |
12 | |
7 | |
5 |