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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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