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
Anonymous
Not applicable

Relationships between 3 tables not working.

Hi

 

Trying to make this as clear as possible.
I have 3 tables: Date, Purchases, Transactions.

3 Visualizations:
Date slicer from Date[date_id] table
Line chart with data from Purchases[Receipt_number] and Transactions[Receipt_number].
Table with data from Purchases[Store, RCP_date, RCP_time, Receipt_number, Value].

Relationships:
Date[date_id]->Purchases[RCP_date]
Date[date_id]->Transactions[RCP_date]

When I move Date slider all the data between these 2 visualizations change accordingly and correctly.
When I pick a value from Table visualization the Line chart line with Transactions data does not change accordingly but the line with Purchases table does. Simple enough there is no relationship between tables Transactions and Purchases. 
I would like to make a new relationship: Purchases[Receipt_number] -> Transactions[Receipt_number] but I can't, it says "that would introduce ambiguity between tables Date and Purchases".
I can remove the relationship between Date and Purchases and create the relationship between Purchases and Transactions but then when I move the Date slider the data in Line chart for Purchases won't change.

 

I need 3 of those visualizations to work with eachother.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create a common table like Receipt_number and join with both table and use

 

Receipt_number = distinct(union(all(Purchases[Receipt_number]) , all(Transactions[Receipt_number] )))

join with both tables and use in slicer or common view

 

or use treatas :https://docs.microsoft.com/en-us/dax/treatas-function

 

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Create a common table like Receipt_number and join with both table and use

 

Receipt_number = distinct(union(all(Purchases[Receipt_number]) , all(Transactions[Receipt_number] )))

join with both tables and use in slicer or common view

 

or use treatas :https://docs.microsoft.com/en-us/dax/treatas-function

 

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.