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

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

Reply
Gopal2704
Frequent Visitor

Changing Columns Names based on parameter/List/Values

Hi guys,

Need help in the below issue:

I have a a list of files named as Name of File_Month_year.xlsx. After transformantions I get a seprate "Year" column having values 2023, 2022, 2021.

But for custom columns i need to keep changing the column names like BUD 2023 - M01, BUD 2022 M02 etc.
Can change the values using a Parameter like :

Parameter 1 : N = 2023

Parameter 2 : N+1 = 2024

Parameter 3 : N+2 = 2025

And so on and call them as :

 

= Table.DuplicateColumn(#"Bud - Year - M12", "T1 - 2023 - M12", Parameter4)

 

Is there a way to do it ?

1 REPLY 1
ppm1
Solution Sage
Solution Sage

Not totally sure what you mean, but yes you can make a parameter for a given year, or (maybe better) a query that dynamically gives the current year with Date.Year(DateTime.LocalNow()). You can then use it in column renaming by concatenating the desired text with Text.From(YearValue + 1), for example.

 

Pat

Microsoft Employee

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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 Kudoed Authors