Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
GerardContlx
Regular Visitor

Adding week of year to date hierarchy

Hello everyone,

 

How can I add the year week to the date hierarchy?

 

Sorry I'm amaterur.

1 ACCEPTED SOLUTION

@GerardContlx  Make sure you mark your Date table as a Date table - see my blog here on how to do that: https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

 

Once you mark it as a date table, that date hierarchy will disappear. You'll then need to re-create it manually and can add Week and any other fields you want to it: 

https://radacad.com/what-a-power-bi-hierarchy-is-and-how-to-use-it 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

4 REPLIES 4
bcdobbs
Community Champion
Community Champion

Hi @GerardContlx 

 

You need to build a custom date table.

 

https://www.sqlbi.com/articles/creating-a-simpler-and-chart-friendly-date-table-in-power-bi/

 

Something a long lines of the above but with an extra line which produces a week number:

https://docs.microsoft.com/en-us/dax/weeknum-function-dax

You can then relate the table to your date field to create your hierachy.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
bcdobbs
Community Champion
Community Champion

If you share a demo file I can add a date table to it for you.



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

GerardContlx_0-1642119107638.png

 

I don´t know hay can I upload the file.

 

@GerardContlx  Make sure you mark your Date table as a Date table - see my blog here on how to do that: https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

 

Once you mark it as a date table, that date hierarchy will disappear. You'll then need to re-create it manually and can add Week and any other fields you want to it: 

https://radacad.com/what-a-power-bi-hierarchy-is-and-how-to-use-it 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors