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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
MintuBaruah
Helper III
Helper III

Match 2 Columns in 2 tables

Hi @all

 

I have 2 tables, Table A and Table B.

The condition is to match 2 columns (ie, Activity Group and Activity) from Table A with 2 columns (ie, Activity Group and Activity Desc) of Table B, so that I can get the data from the third column in Table B.

For eg: 

 

Table A:

Activity Group Activity
Internal Admin Internal Admin
Fund Account NAV
Fund Account Invest
Fund Account Internal Admin

 

Table B: 

Activity Group Activity  Rates
Internal Admin Trades B
Fund Account NAV C
Fund Account  Report A
Internal Admin Invest B

 

In the above tables, 

Fund Account from Table A Matches with Table B, So it should fetch C from Rates Column.

 

Please help how to solve this in power bi.

 

Thank you.

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @MintuBaruah,

I'd like to suggest you take a look at the following link about creating relationships between many columns:

Relationship in Power BI with Multiple Columns - RADACAD

You can create a calculated column concatenate these two column values and extract them to create a new clause table as the bridge to link two tables based on the merge field values.

How to Join Many to Many with a Bridge Table in Power BI | Seer Interactive

After these steps, you can simply get the related field value based on the relationship keys.
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

9 REPLIES 9
v-shex-msft
Community Support
Community Support

Hi @MintuBaruah,

I'd like to suggest you take a look at the following link about creating relationships between many columns:

Relationship in Power BI with Multiple Columns - RADACAD

You can create a calculated column concatenate these two column values and extract them to create a new clause table as the bridge to link two tables based on the merge field values.

How to Join Many to Many with a Bridge Table in Power BI | Seer Interactive

After these steps, you can simply get the related field value based on the relationship keys.
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Tahreem24
Super User
Super User

@MintuBaruah Find the attached PBIX file for your reference.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Hi @Tahreem24 

 

This is not correct as it is showing B also in Rates.

Conditition: fetch Rates only if Both Activity Group and Activity columns matches with the other tables Activity Group and Activity.

 

Thank you.

@MintuBaruah Create this DAX Column:

Column = IF(TableA[Activity Group]=RELATED(TableB[Activity Group]) && TableA[Activity]=RELATED(TableB[Activity Desc]),RELATED(TableB[Rates]),BLANK())
Capture.JPG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

Hi @Tahreem24 

 

Thank you for the reply.

Could you please check the question again as i have added a few rows because i have data similar to the updated data.

 

I tried the solution but it is showing an error.

 

Regards.

@MintuBaruah  Then try this:

Join based on Activity column.

 

Column = IF(TableA[Activity Group]=RELATED(TableB[Activity Group]) && TableA[Activity]=RELATED(TableB[Activity ]),RELATED(TableB[Rates]),BLANK())
Capture.JPG
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24 , 

 

I am still getting the error as Activity column also has duplicate data in both the tables.

 

Thank you

Arul
Super User
Super User

Hi @MintuBaruah ,

 

Just create the relationship between Activity Group of the tables.

 

Thanks,

Arul





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

Proud to be a Super User!


LinkedIn


Hi @Arul 

 

Thank you for the reply.

 

I have tried that but by doing that It will also fetch B from Table B because Internal Admin matches. 

The conditition is to fetch Rates only if Both Activity Group and Activity columns matches with the other table.

 

Regards.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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