Forum

What is the best wa...
 
Notifications
Clear all

What is the best way to merge (index & match in Excel) column with two different tables in Power Query

4 Posts
2 Users
0 Reactions
133 Views
(@bluesky63)
Posts: 162
Estimable Member
Topic starter
 

Hi Catalin / Mynda

In Excel,  I can use 

=IFERROR(INDEX('Table 1'!B:B,MATCH(A2,'Table 1'!A:A,0)),INDEX('Table 2'!B:B,MATCH(A2,'Table 2'!A:A,0)))

How about in Power Query,

See my attached excel,  source query done half way,  what is the best method to put album and details in two columns

 
Posted : 26/11/2019 11:09 am
(@catalinb)
Posts: 1937
Member Admin
 

Hi Chris,

Append Table2 to Table 1, this will create a single table with all data. Use this single full table to merge it with the single column table.

 
Posted : 26/11/2019 11:47 am
(@bluesky63)
Posts: 162
Estimable Member
Topic starter
 

Hi Catalin,

Yes, however in real life,  the Table 1 and Table 2 and subsequent tables are with different headers,  by appending them together will be very messy,  so is there an equivalent M Code for

=IFERROR(INDEX('Table 1'!B:B,MATCH(A2,'Table 1'!A:A,0)),INDEX('Table 2'!B:B,MATCH(A2,'Table 2'!A:A,0)))

or nested loop for looking up values from one table to another....    if UI cannot do it

 
Posted : 27/11/2019 9:07 am
(@catalinb)
Posts: 1937
Member Admin
 

I really cannot see the problem you see. You just have to rename the columns that have the same data before append, the append will work.

Provide samples closer to reality, this will help you get a more useful answer.

 
Posted : 27/11/2019 9:55 am
Share: