Move Column Contents in Power Query

AllisterB

Board Regular
Joined
Feb 22, 2019
Messages
120
Office Version
  1. 365
Platform
  1. Windows
I have headers in trow 1 that are the targets
The row below that has similar headers but in a different order.
I need to move the contents of the columns (row3 down) to sit under the most appropriate Header.

What is the best approach?
201.xlsx
HIJKL
3Part NumberNamePriceMaterialSize
4SizePart #NamePrice
5LargeSJD-23Wheel10
6SmallKLJ-26Bolt5
Sheet1

Thanks

Allister
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
See attached
201.xlsx
HIJKL
3Part NumberNamePriceMaterialSize
4SizePart #NamePrice
5
6
7
8RESULT
9Part NumberNamePriceMaterialSize
10SJD-23Wheel10Large
11KLJ-26Bolt5Small
Sheet1
 
Upvote 0
Original
Part NumberNamePriceMaterialSize
LargeSJD-23Wheel10
SmallKLJ-26Bolt5
Helper table
Part NumberNamePriceMaterialSize
SizePart NumberNameMaterialPrice
Result
Part NumberNamePriceMaterialSize
SJD-23Wheel10Large
KLJ-26Bolt5Small

Power Query:
let
    Tbl1 = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Helper = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
    Append = Table.Combine({Helper, Tbl1}),
    Promote = Table.PromoteHeaders(Append, [PromoteAllScalars=true]),
    TSC = Table.SelectColumns(Promote,{"Part Number", "Name", "Price", "Material", "Size"})
in
    TSC
 
Upvote 0

Forum statistics

Threads
1,225,653
Messages
6,186,203
Members
453,340
Latest member
yearego021

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