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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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