Forum Discussion

mahra-in's avatar
mahra-in
Icon for Helper II rankHelper II
8 years ago
Solved

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

 

 

Please help minimum on how to relate these two tables

  • 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'.

     

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

     

    Best regards,

    Yuliana Gu

4 Replies

  • 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.

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Icon for Microsoft Employee rankMicrosoft 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'.

     

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

     

    Best regards,

    Yuliana Gu

    • mahra-in's avatar
      mahra-in
      Icon for Helper II rankHelper II

      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

       

       

       

       

       

       

       

       

       

       

       

       

       

       

      • mahra-in's avatar
        mahra-in
        Icon for Helper II rankHelper II

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