cancel
Showing results for 
Search instead for 
Did you mean: 
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.

Check out my Olympics report with live stats - KUDOS much appreciated

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
Super User
Super User

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!!

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.

Check out my Olympics report with live stats - KUDOS much appreciated

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
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!