Forum Discussion

AnandNamburi's avatar
AnandNamburi
Icon for Helper III rankHelper III
5 years ago
Solved

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 

  • 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:  

       

    Thanks,

    Pragati

1 Reply

  • 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:  

       

    Thanks,

    Pragati