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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Cleaning up column headers

Hi All, 

 

I am cleaning up column headers I have the following on a merged query:

Some of the columns from the original tables are slightly different

 

I am cleaning up the 'questions' and I am using the following code:

#"Renamed Columns" = Table.RenameColumns(#"Added Custom",Table.ToRows(#"Course Fields"))

 

Survey Question StatusSurvey Question Status
Survey Questions StatusSurvey Question Status

 

I am getting the following error:

Expression.Error: The field 'Survey Question Status' already exists in the record.
Details:
Name=Survey Question Status
Value=

 

Anyone know how to amend the code to enable it to handle the duplicates and merge them to the correct name?

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous 

I'm afraid i cannot fully understand it.Could you share some data sample and expected output?Find some articles for you to check if they could help.

https://prathy.com/2017/03/modify-column-names-using-m-functions/

https://dataveld.com/2015/08/08/step-by-step-using-power-query-to-replace-text-in-table-headers/

For 3rd party Links:

Please understand that this link is provided “AS IS” with no warranties or guarantees of content changes, and confers no rights.

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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