web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How To Dynamic Rename ...
Power Apps
Unanswered

How To Dynamic Rename Column Headers: [Month] & [Current Year] in P. Query

(0) ShareShare
ReportReport
Posted on by 2

I am new beginner of Power Query. My current raw data (1st screenshot below) consists of column headers (Column B - M) without [Year Name]. 

 
Column AColumn BColumn CColumn DColumn EColumn FColumn GColumn HColumn IColumn JColumn KColumn LColumn M
 JanFebMarAprMayJuneJuly AugSeptOctNovDec
Sales100100100100100100100100100100100100
Expense100100100100100100100100100100100100

 

 

I manually added in [2022] in Query Editor for all months (Jan - Dec). However, when come to next year, i will have to do the similiar manual exercise to replace col. header with [2023], which bit inefficient. 

 

 

Table.RenameColumns(#"Removed Columns2",{"Jan", "Jan 2022"}, {"Feb", "Feb 2022"}, {"Mar", "Mar 2022}, {"Apr", "Apr 2022"}, {"May", "May 2022", {"June", "Jun 2022"}, {"Jul", "Jul 2022"}, {"Aug", "Aug 2022"}, {"Sep", "Sep 2022"}, {"Oct", "Oct 2021"}, {"Nov", "Nov 2022"}, {"Dec", "Dec 2022"}})

 

 

let's assume i key in "2023" in Excel Cell A1 in another worktab within same workbook. 

Year
2023

 

wonder if any better way which i can dynamic col. header name in P.Query Editor, base on [Year] selection from excel cell A1, and concentrate with [Month]? 

 

 

 

 

 

 

 

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard