Forum Discussion

Sitak_Johar's avatar
Sitak_Johar
Frequent Visitor
2 years ago
Solved

How to join two tables without unique values?

Hello All,

 

I am having trouble to create a relationship between 2 tables to create the expected output visual.

 

I have two tables: Table 1 and Table 2
Sample of Table 1 is:

Server NameContactContact.1Contact.2Contact.3Contact.4Contact.5
ABC(delimiter)A(delimeter)B(delimiter)CABC  
DEF

(delimiter)A(delimeter)D(delimiter)E(delimiter)F

ADEF 
GHI(delimiter)A(delimeter)E(delimiter)G(delimiter)H(delimiter)IAEGHI

 

Some background on Table 1:

  • The original table only has the 1st 2 columns - server name and contact
  • Contact column has all the contact ID's for a particular server but they are all contained in one text
  •  Hence I've split up the Contact column using Power Pivot with a common delimiter and the results are the columns starting from Contact.1
  • The number of contacts are not pre-defined, it could be anywhere between 1 or 50 or even more

 

Sample of Table 2:

Resource IDResource Name
ABrian
BDavid
CJulien
DMichael
EJack
FSam

 

Some background on Table 2:

  • For each Resource ID, we have the resource Name

 

Relation between Table 1 and Table 2:

  • The contact field's starting with contact.1 etc. are the resource ID in the 2nd table
  • Here I am having difficulty to create the appropriate relationship in Power BI since the values in Table 1 are lined up in a row instead of a column

 

Expected Output:

Server NameResource IDResource Name
ABCABrian
BDavid
CJulien
DEFABrian
DMichael
EJack
FSam

 

OR it could be the following output:

Resource IDResource NameServer Name
ABrianABC, DEF
BDavidABC
CJulienABC
DMichaelDEF
EJackDEF
FSamDEF



Any one of the output could work.

 

Thanks,

VH

  • Sitak_Johar You can split your values into rows and then from there it will be easier to set the relationship and contacts will be on seperate rows instead of multiple columns.

1 Reply

  • Sitak_Johar You can split your values into rows and then from there it will be easier to set the relationship and contacts will be on seperate rows instead of multiple columns.