Power Query. Merged 2 tables, but after renaming column name from 2nd table, expand column does not select this renamed column

martinli

New Member
Joined
Jul 25, 2018
Messages
4
Hi,

I have two tables, Table 1 and Table 2.

INDEXSexAge
0M10
1F10
2M12

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>


INDEXName
School
0TomTest
1MaryTest1
2TommyTest

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>


I merged the two tables into Marge1

INDEXSexAgeNameSchool
0M10TomTest
1F10MaryTest1
2M12TommyTest

<colgroup><col style="text-align: center;"><col style="text-align: center;"><col style="text-align: center;"><col style="text-align: center;"><col style="text-align: center;"></colgroup><tbody>
</tbody>


If i rename Table 2 column heading from School to test, the Merge does not display this renamed column. Is there an easy solution for this?

Thanks in advance.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
After trying a couple of things i came up with the following:


let
Source = Table.NestedJoin(Table1,{"INDEX"},Table2,{"INDEX"},"NewColumn",JoinKind.FullOuter),
#"Expanded NewColumn" = Table.ExpandTableColumn(Source, "NewColumn", List.Difference(Table.ColumnNames(Table2), {"INDEX"}))
in
#"Expanded NewColumn"



I basically tell the table not to select the "INDEX" from the second table. Kind of a hassle but it works.
 
Upvote 0

Forum statistics

Threads
1,215,208
Messages
6,123,642
Members
449,111
Latest member
ghennedy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top