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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
BooDaa
Frequent Visitor

Trying to figure out Date table

Hi guys!
I have come to understand that a universal date table is a pre requisite if I want to compare more than one date per row in a visualization (start/end, open/close, hire/termination and so on). My main source of inspiration this far is @amitchandaks article https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Problem:

My main set of records where created during current or previous two calendar years, so I am used to a slicer looking like this:

BooDaa_0-1684247955583.png

However, when I create a relation between the two table my hierarchy break and I am left with individual dates.

BooDaa_1-1684248307056.png

 


If i try to use the hierarchy from the date table my slicer span from 2021 to 2121, and I can't quite figure out why.

Questions:

- Is there a way to create a relation between my main table and date table without breaking the hierarchy?
- Should I use the date table for my slicer and filter it by dates available in my main table?

BooDaa_2-1684248589453.png

 

Best regards,
Fredrik

1 REPLY 1
amitchandak
Super User
Super User

@BooDaa , No. The join column will not have a hierarchy. Also, Date of date column used as date(when you mark as a date table) will not have a hierarchy

 

You can use date keys to join (so date retain hierarchy)

Datekey = year([Date])*10000 + month([Date]) *100 + day([date])

 

or duplicate the date

Date1 =[Date]

 

The new dates or some other dates can have a hierarchy.

I personally do not use default date hierarchy, it can break time intelligence

 

I create columns in date table and use those

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.