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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pelowski
Helper III
Helper III

Date Hierarchy falls to appear when joining on the date

I'm not sure if this is a bug or if we're doing something incorrectly, but we've had a heck of a time trying to figure out why a few dates weren't showing up as hierarchies when we bring them into a report. When we have a date in our query, we try to join it on a DimDate table that has a lot more information about the Date including things like the Day Name, the Week Number, etc.  However, when joining on this Date, PowerBI no longer allows it to have a hierarchy when we bring it into a report.

 

These are the things we've looked at...

  1. Both dates are formatted as dates.
  2. The joins work regardless of which field we use.
  3. When we try to join on just the date (rather than the integer representation of that date) the hierarchy does not appear.

 

We've had to add this to all of our dates instead and then join on this field.

CAST(CONVERT(VARCHAR(8),OrdDetShipDate,112) AS INT) AS ShipDateInt,

 

PowerBI - Date Hierarchy - This Does NOT Work.pngPowerBI - Date Hierarchy - This Works.png

 

We also looked at this thread while trying to find an answer to this, but this appears to be different.  We're using "Import" for our query.

https://community.powerbi.com/t5/Desktop/Date-hiearchy-does-not-work-automatically-in-case-of-Direct...

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @pelowski,

 

 

When you have a date Power BI automatically generate different views for different time hierarchies however when, you have a connection between tables (using date format) what happens is that the main date (table in wich you have the one in one-to-many relationship) is the one that get the hierarchy "treatament", so in your example when you need to use the Date in Calendar and not the Ship Date on your visuals.

 

I would discard the DateKey (int) and use the Dates to link between the two tables and use the date field on your calendar.

 

Regards,

MFelix 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @pelowski,

 

 

When you have a date Power BI automatically generate different views for different time hierarchies however when, you have a connection between tables (using date format) what happens is that the main date (table in wich you have the one in one-to-many relationship) is the one that get the hierarchy "treatament", so in your example when you need to use the Date in Calendar and not the Ship Date on your visuals.

 

I would discard the DateKey (int) and use the Dates to link between the two tables and use the date field on your calendar.

 

Regards,

MFelix 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors