Forum Discussion
Relationship between 2 date columns in 2 tables
Hi,
I have 2 tables A and B and I have a slicer for year on the page. However, it is filtering only the year of one table A since it is year of date in table A and table A and B are not related.
I am created a relationship between date1 in table A and date2 in table B. Howver, once I do that table A[date1].date is no longer coming and all the coloumns like month, year etc based on it are throwing error.
Post removing the relationship the error gets solved.
Any clue how to fix this?
Thanks in advance!
3 Replies
- amitchandak
Super User
Anonymous , Create a common date table and join it both the table. In that be table have year column ,use that to filter
If any of the table's date has a timestamp, then prefer a new date only column
Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
- AnonymousNot applicable
amitchandak : Already tried this but getting the same error.
- AnonymousNot applicable
Hi Anonymous ,
Is there any error message? Or is there any other operations like measures or any other related table?
It's better to share pbix file if you don't have any Confidential Information.
Best Regards,
Jay