Power Query: Promoting/Demoting Headers

jajatidev

Board Regular
Joined
Jul 29, 2016
Messages
78
Office Version
  1. 365
Platform
  1. Windows
Hi,
The "Report Date" column is from the Expanded Data step.

After expanding all column headers are in the first row except for Report Date, due to this when I promote the headers the data in Report Date Column gets promoted at the column header which I then rename.
Renaming is causing the query to break because the date keeps changing.

If I have to demote then how do I demote the Report Date header name only
If I have to promote then how do I promote Header Names except for Report Date

Please advise.

Thanks.

1715712622205.png


1715712584559.png


1715712697581.png
 

Attachments

  • 1715712669341.png
    1715712669341.png
    7.8 KB · Views: 7

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
After you promote first row to headers, add a step like

Power Query:
ReportDateHeading = Table.ColumnNames(#"Promoted Headers"){0}

then to change the Heading to "Report Date"

Power Query:
tbl = Table.RenameColumns(#"Promoted Headers",{{ReportDateHeading, "Report Date"}})
 
Upvote 0
Solution
After you promote first row to headers, add a step like

Power Query:
ReportDateHeading = Table.ColumnNames(#"Promoted Headers"){0}

then to change the Heading to "Report Date"

Power Query:
tbl = Table.RenameColumns(#"Promoted Headers",{{ReportDateHeading, "Report Date"}})
Thank you, Gordon.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,183
Members
452,615
Latest member
bogeys2birdies

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