Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Get value from another table

Hi, I would appreciate any help on the following. I have 2 tables as follows:

 

Table1

IDDateAmount
1231-Jan-01100
2347-Jul-02297

 

Table2

IDDescriptionCategory
123Hello WorldBook
234Sunny DayE-Book

 

I would like to populate the 'Description' column in Table2 to Table1. New Table1 will be as follows:

IDDateAmountDescription
1231-Jan-01100Hello World
2347-Jul-02297Sunny Day

 

How do i do that with Power Query Editor? Thanks!

  • Hi Anonymous ,

     

    In Power Query, select your Table1 query.

    Go to the Home tab > Merge Queries.

    In the top preview section of the dialog, select the [ID] column.

    In the bottom preview section, select Table2 from the dropdown list and also select the [ID] column from here.

    Leave the join type as Left Outer for now, you can always change it later.

     

    Pete

3 Replies

  • Hi Anonymous ,

     

    In Power Query, select your Table1 query.

    Go to the Home tab > Merge Queries.

    In the top preview section of the dialog, select the [ID] column.

    In the bottom preview section, select Table2 from the dropdown list and also select the [ID] column from here.

    Leave the join type as Left Outer for now, you can always change it later.

     

    Pete

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Pete! Thanks for your reply! What if Table2 has other columns that I don't want to be included in Table1? Sorry I didn't give a complete picture in my earlier post.

      • BA_Pete's avatar
        BA_Pete
        Super User

         

        No problem. Once the merge is complete, it will appear as a column full of nested tables. Just hit the button at the top right of your new column (it looks like two arrows pointing away from each other) and PQ will give you a pick-list of which columns you want to expand from the merged table.

         

        Pete