cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
marianamarques Regular Visitor
Regular Visitor

Date table - Relationship

Hi all,

Can you please help me to figure out why my date relationship is not working?

I have the exact same format  as the one I have on my date table. Also I have created the relationship between the tables and it's active, the cross filter direction is set as "both" .

 

For some reason when I try to create the clustered column chart the dates are not being considered. 

I tried to add it in the axis and as a legend from my date table.

 

Does anyone know why this could possibly be happening?

 

Thank you,

 

Mariana 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Date table - Relationship

Hey,

 

this can happen if the datatype of the columns that form the relationship is set to datetime, be aware that datatype does not mean format.

 

If you use the DAX function CALENDAR() to create the timeframe of your calendar the default datatype for the date column is datetime, this means there is always a time part in the value of the date column:

Date DataType vs Format.png

 

For this reason I always make sure that the data type of the date column is DATE (unless I need the timepart, but then I would almost create a separate time table).

 

Check if both columns have the datatype DATE. If not maybe you need to create an extra column of this datatype and rebuild your relationship on these columns and also use these columns in your visualizations and slicers.

 

Most of the time this already does the trick.

 

Hope this helps

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
2 REPLIES 2
Super User
Super User

Re: Date table - Relationship

Hey,

 

this can happen if the datatype of the columns that form the relationship is set to datetime, be aware that datatype does not mean format.

 

If you use the DAX function CALENDAR() to create the timeframe of your calendar the default datatype for the date column is datetime, this means there is always a time part in the value of the date column:

Date DataType vs Format.png

 

For this reason I always make sure that the data type of the date column is DATE (unless I need the timepart, but then I would almost create a separate time table).

 

Check if both columns have the datatype DATE. If not maybe you need to create an extra column of this datatype and rebuild your relationship on these columns and also use these columns in your visualizations and slicers.

 

Most of the time this already does the trick.

 

Hope this helps

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
marianamarques Regular Visitor
Regular Visitor

Re: Date table - Relationship

Thank you @TomMartens, in the modeling table I was seeing it as "Date" type but when I clicked in "Edit Query" and checked in the "Transform" tab it was showing as "Date/Time" so then I changed it and it works now. 

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 31 members 830 guests
Please welcome our newest community members: