Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Vishruti
Helper I
Helper I

Connecting Tables with Multiple Columns

I have following two tables.

IMG_0195.jpeg

 

IMG_0194.jpeg

One is a master table which consists of a master list of Site names along with ID and Vendor Type.

 

The second table consists of product codes and 4 different types of Sites columns. The sites, in all of these 4 columns, comes from the master site table. 

How can I create relationship between these two tables based on Sites?

 

Eventually, I want plot the second data table in Table visual and use Vendor Type and Site Names from first table as a filters. 

1 ACCEPTED SOLUTION
AmiraBedh
Super User
Super User

I think vefore creating a relationship, you should have a unique list of all site names. In your second table, you have multiple site columns (Site A, Site B, Site C, Site D). You might need to transform it into a format that has a single column for the site names to create a more straightforward relationship. You can achieve this by unpivoting the Site columns in the Query Editor so that you have a single column that lists the site name against each Product Code.

 

After that, you can create a relationship between the Site Name field from the master table anf the "Site" field in the transformed product table (Many to One)


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

View solution in original post

1 REPLY 1
AmiraBedh
Super User
Super User

I think vefore creating a relationship, you should have a unique list of all site names. In your second table, you have multiple site columns (Site A, Site B, Site C, Site D). You might need to transform it into a format that has a single column for the site names to create a more straightforward relationship. You can achieve this by unpivoting the Site columns in the Query Editor so that you have a single column that lists the site name against each Product Code.

 

After that, you can create a relationship between the Site Name field from the master table anf the "Site" field in the transformed product table (Many to One)


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors