Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register 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 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 10 | |
| 10 | |
| 7 | |
| 5 |