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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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