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
mahra-in
Helper II
Helper II

Manage Relationship between two tables without unique values

Hi

 

I need to manage a relationship with two tables

 

Table 1

 

RegionSpend
ASEC54555
EMEAI64363
EMEAI45455
ASEC5554
AMER2254
ASEC2244
AMER55558

 

Table 2

 

RegionSavings
EMEAI500
ASEC250
ASEC200
AMER150
EMEAI100
AMER444

 

Result:

 

RegionSpendSavings
AMER57812594
ASEC62353450
EMEAI109818600
Total2299831644

 

Visual shall be

 

Capture.PNG

 

Please help minimum on how to relate these two tables

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @mahra-in,

 

You need to create a bridge table named as 'Table3'.

Table3 =
UNION (
    VALUES ( Table1[Region] ),
    EXCEPT ( VALUES ( Table2[Region] ), VALUES ( Table1[Region] ) )
)

Create a one-to-many relationship from 'Table3' to 'Table1' and 'Table2'.

1.PNG

 

Then, drag 'Table3'[Region] and 'Table1'[Spend] and 'Table2'[Savings] to visual.

3.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

4 REPLIES 4
v-yulgu-msft
Employee
Employee

Hi @mahra-in,

 

You need to create a bridge table named as 'Table3'.

Table3 =
UNION (
    VALUES ( Table1[Region] ),
    EXCEPT ( VALUES ( Table2[Region] ), VALUES ( Table1[Region] ) )
)

Create a one-to-many relationship from 'Table3' to 'Table1' and 'Table2'.

1.PNG

 

Then, drag 'Table3'[Region] and 'Table1'[Spend] and 'Table2'[Savings] to visual.

3.PNG

 

Best regards,

Yuliana Gu

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

What if I have multiple colums and want to create relationship between table 1 & table 2.

 

Do I have to create bridge table for all columns separately to pull savigs & spend with respect to Region, Country or Entity?

 

Table 1

Region
CountryEntitySpend
ASECAustraliaEntity 154555
EMEAIDenmarkEntity 364363
EMEAIIndiaEntity 245455
ASECChinaEntity 15554
AMERBethlehemEntity 32254
ASECAustraliaEntity 52244
AMERSalt Lake CityEntity 455558

 

Table 2

Region
CountryEntitySavings
EMEAIIndiaEntity 2500
ASECChinaEntity 1250
ASECChinaEntity 1200
AMERSalt Lake CityEntity 4150
EMEAIDenmarkEntity 3100
AMERSalt Lake CityEntity 4444

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Is there a way to remove blank or null rows in the bridge table

RolandsP
Resolver IV
Resolver IV

You need to create a Bridge table with only one column that contains unique Region values. Then you can link Table1 and Table2 through the Bridge table.

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.