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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
aignn
Helper II
Helper II

Is it possible to dynamically change the column name in a visual element?

Hi all!

 

is it possible to dynamically change the column name in a visual element?

 

I have query from SQL. A column is also added to this query using power query. Which will be named differently each month (Completed 17.02.20, Completed 17.03.20 etc)

 

And i have visual element Table which has this column. 

How can I make the column name also change dynamically? Now if the query changes the name of a column, I get an error in the visual element, because such a column was not found.

 

Thank you advanced

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@aignn ,

 

I'm afraid this could not be achieved, you need to modify the column headers manually in power query, please refer to doc below:

https://support.office.com/en-us/article/rename-a-column-power-query-d72034d0-f271-4b62-bb57-1cce49d...

 

Community Support Team _ Jimmy Tao

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

View solution in original post

4 REPLIES 4
danextian
Super User
Super User

Hi @aignn ,

 

I can think of using a Matrix and unpivot and other tricks in Power Query to get your desired result but not using a table. In the Query Editor:

  • Start by navigating to your data source
  • If Power BI automatically detects the data types, remove that step. You don't want any step that references a column just yet.
  • Select the columns that will be constant in your data. Right click then hit Unpivoted Other Columns which will generate Attribute and Value columns by default. Apply changes.
  • In the designer, select the matrix visual and put the Attribute column to Columns. 

In this approach, the Attribute column will be a constant in your data model (unless renamed). What will appear in the Columns of the matrix visual is the name of the column that changes name.

  •  




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
v-yuta-msft
Community Support
Community Support

@aignn ,

 

I'm afraid this could not be achieved, you need to modify the column headers manually in power query, please refer to doc below:

https://support.office.com/en-us/article/rename-a-column-power-query-d72034d0-f271-4b62-bb57-1cce49d...

 

Community Support Team _ Jimmy Tao

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

Pragati11
Super User
Super User

Hi @aignn ,

 

Power Bi will always give an error in the cases where the column names differ - like in your case you are writing SQL Query to extract data for this month with a COLUMN_A, next month you use same query but with COLUMN_B. You need to keep column name same in your query. I have found the following article which may help you to resolve the dynamic column name issue:

https://www.goodly.co.in/dynamic-column-names-power-query/

 

Let me know if that works.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

JirkaZ
Solution Specialist
Solution Specialist

@aignn I guess you cannot dynamically change the column names in the visual. What you could do is to put a card visual over the column name and populate the value of the card with a measure value resulting in the wanted text.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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