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

Multiple relationships between tables

I've got my table 'Item', which has 6 fields I need to relate to another table: 'Item Category 1' to 'Item Category 6'.  
All these 6 category fields need to be joined to the table 'Item Category'. I started by making a relation between Item.Category1 to Item Category.Code and did this for all 6 categories.

For some reason I can't seem to get all these 6 relations in place, since only 1 can be active. 
Could someone help me on my way to get all 6 working? The first relation is working properly. 

P.S.: In SQL the query I would make the result would look like this:

 

SELECT *
FROM Item i 
LEFT OUTER JOIN  Item Category ice1 on  i.category 1 = ice1.code

LEFT OUTER JOIN  Item Category ice2 on  i.category 2 = ice2.code

LEFT OUTER JOIN  Item Category ice3 on  i.category 3 = ice3.code

LEFT OUTER JOIN  Item Category ice4 on  i.category 4 = ice4.code

LEFT OUTER JOIN  Item Category ice5 on  i.category 5 = ice5.code

LEFT OUTER JOIN  Item Category ice6 on  i.category 6 = ice6.code

  

2 ACCEPTED SOLUTIONS
LivioLanzo
Solution Sage
Solution Sage

Hi @Anonymous

 

you need to unpivot both tables and show the category only one column, and then relate the tables by this column

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

You may also take advantage of USERELATIONSHIP in DAX.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous ,

 

You may also take advantage of USERELATIONSHIP in DAX.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
LivioLanzo
Solution Sage
Solution Sage

Hi @Anonymous

 

you need to unpivot both tables and show the category only one column, and then relate the tables by this column

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

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.