How to append tables in Power Query while merging similar columns which have different names, types and order?

0

I have 2 tables with similar values but different names, types and order of the columns.

What's the best way to merge them into a single table? I believe the 2 options are Append or Merge with Full Outer.

Table1 (order 1-2-3):

Name    ID  Number
John    1234    324234
Steve   1230    124536
Deb     1293    968578

Table2 (order 3-2-1):

Figure  Unique  Whois
3242345 abc     Johnny
124537  fdg     Stevenson
968578  jgn     Debon

The merged table should look like:

Name        ID      Number
John        1234    324234
Steve       1230    124536
Deb         1293    968578
Johnny      abc     3242345
Stevenson   fdg     124537
Debon       jgn     968578

When choosing Merge, it allows mentioning the relations between the columns.

But when choosing Append, it doesn't.

Excel's Power Query's Append

So this is the result:

Appended merged table

Compare this to Merge, which fails due to different types.

Excel's Power Query's Merge

LWC

Posted 2019-10-25T18:42:40.103

Reputation: 263

Answers

1

I would use Append, but first I would add steps to the test2 query to rename the columns to match test1. Append aligns columns using column names only (not position).

I would also change the datatype of the ID column in the test1 query to Text, to accomodate the values in the Unique column from the test2 query.

Mike Honey

Posted 2019-10-25T18:42:40.103

Reputation: 2 119