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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply

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

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

6 REPLIES 6
TomMartens
Super User
Super User

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



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Awesome! Thanks for your help!

This isn't working for me, as the calendar table I generated doesn't show up in my queries screen.  It only exists as a table in my project.

No Calendar Query to edit:
no calendar.PNG

 

Calendar Table Exists:

calendar.PNG

 

code to generate calendar:

code for calendar.PNG

Hey @fuqmicrosoft (I have to admit that I find your username somewhat offensive, even if I do not work for microsoft),

 

I guess you created your Calendar table using DAX, this means the table will be created after the data model will be created by "Refresh Data". This will explain why the Calendar table does not show up inside your queries screen.

 

If you need the Calendar table inside the queries screen, you have to create a Calendar table using M, maybe this article gets you started: https://exceleratorbi.com.au/build-reusable-calendar-table-power-query/

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Understand.

 

A DAX based table will never appear in the queries pane, as DAX based table will be addes to the data model after data refresh

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.