Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
tomperro
Helper V
Helper V

Merge Multiple Tables with Different Column Names

I am trying to merge multiple tables with different column names

- Can I rename the columns in each table?
- Can I create a mapping table and use this in BI somehow?
- Are there any tutorials on how to merge multiple tables with different column names?
- Other Options???

1 ACCEPTED SOLUTION

Table1:

lbendlin_2-1745856799723.png

 

Table2:

lbendlin_3-1745856820674.png

 

Mapping:

lbendlin_0-1745856586759.png

 

Then do the append and column rename:

lbendlin_1-1745856750409.png

// Table1
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXICYmel2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t])
in
    Source

// Table2
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclHSUXIFYjel2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column2 = _t, Column3 = _t, Column4 = _t])
in
    Source

// Append1
let
    Source = Table.Combine({Table1, Table2}),
    #"Renamed Columns" = Table.RenameColumns(Source,List.Zip({Mapping[From],Mapping[To]}),MissingField.Ignore)
in
    #"Renamed Columns"

// Mapping
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PKc3NM1TSgbIclWJ1YKJGcFEnJFFjuKgzkqgJXNQFSdQULuqqFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [From = _t, To = _t])
in
    Source

 

 

View solution in original post

5 REPLIES 5
v-nmadadi-msft
Community Support
Community Support

Hi @tomperro ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If our responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

v-nmadadi-msft
Community Support
Community Support

Hi @tomperro 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

 

lbendlin
Super User
Super User

Please note that "merge"  and "append"  do different things in Power Query. Please clarify which of the actions you need.

 

- yes, you can rename columns

- yes, you can create a mapping table and bulk replace column names

I need to append the tables. 
How would I create a mapping table and bulk replace column names?

Table1:

lbendlin_2-1745856799723.png

 

Table2:

lbendlin_3-1745856820674.png

 

Mapping:

lbendlin_0-1745856586759.png

 

Then do the append and column rename:

lbendlin_1-1745856750409.png

// Table1
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUXICYmel2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t])
in
    Source

// Table2
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclHSUXIFYjel2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column2 = _t, Column3 = _t, Column4 = _t])
in
    Source

// Append1
let
    Source = Table.Combine({Table1, Table2}),
    #"Renamed Columns" = Table.RenameColumns(Source,List.Zip({Mapping[From],Mapping[To]}),MissingField.Ignore)
in
    #"Renamed Columns"

// Mapping
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PKc3NM1TSgbIclWJ1YKJGcFEnJFFjuKgzkqgJXNQFSdQULuqqFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [From = _t, To = _t])
in
    Source

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors