Forum Discussion
Date table - Relationship
- 9 years ago
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:
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
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:
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
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:
Calendar Table Exists:
code to generate calendar:
- TomMartens6 years agoSuper User
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
- TomMartens6 years agoSuper User
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