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
AnandNamburi
Helper III
Helper III

How to join on two tables based on multiple conditions

Hi All,

 

I have 2 tables lets assume Table A and Table B.

I want to join these two tables on multiple conditions like

 

table A.Id Number right ouer join tableB.Id Number and  tableA.startDate right ouer join tableB.StartDate and tableA.enddate right ouer join tableB.end date.

 

Can anyone suggest me how can I specify these type of custom joins/multiple join contions 

1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

HI @AnandNamburi ,

 

You can merge on multiple columns in Power Query Editor.

  1. Click your table in Power Query Editor.
  2. Under top ribbon -> Select Merge Queries as New
  3. Then a new window appears
  4. Select both the tables you want to join
  5. Select the 1st column from Table A then 1st column in Table B
  6. Now if you want to join on multiple columns --> On windows machine use Ctrl key to select 2nd column in Table A and do same for Table B.
  7. You end up with the multi-column selection for both tables. Something shown below:  Pragati11_0-1634118630256.png

     

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

1 REPLY 1
Pragati11
Super User
Super User

HI @AnandNamburi ,

 

You can merge on multiple columns in Power Query Editor.

  1. Click your table in Power Query Editor.
  2. Under top ribbon -> Select Merge Queries as New
  3. Then a new window appears
  4. Select both the tables you want to join
  5. Select the 1st column from Table A then 1st column in Table B
  6. Now if you want to join on multiple columns --> On windows machine use Ctrl key to select 2nd column in Table A and do same for Table B.
  7. You end up with the multi-column selection for both tables. Something shown below:  Pragati11_0-1634118630256.png

     

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!