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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jeongkim
Helper V
Helper V

Rename column names in query as per sheet name

 

Can we rename the column names as per sheet name?

e.g. if sheet name starts 2024 then one of columns to be 2024 blabla,

if sheet name starts 2025 then to be 2025 babla,

 

Since I renamed manually for all columns to add year number 2024 as data source has very old format which has many of empty column names. 

But the thing is year will change and 2024 should be 2025 next year.

 

jeongkim_0-1704953350535.png

 

Or, as per one of cell name which is always locatetd there starting with year number like below 

jeongkim_2-1704953793696.png

 

So if I could take '2024' from column 13 cell in red circle, then I can make custom column pasting '2024' for all rows and this can be combined with Q1_QTY, Q2_QTY... then no need to rename them with particualr year number. 

 

1 REPLY 1
v-kongfanf-msft
Community Support
Community Support

Hi @jeongkim ,

 

Can you provide relevant screenshots describing your desired outcome? Is it something like using dynamically selected columns in power query as mentioned in the solution below?

powerbi - Power BI / query, select columns dynamically - Stack Overflow


Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.