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
monojchakrab
Resolver III
Resolver III

rename column headers of nested tabled with same column name

Hiya good people of PQ,

 

I am trying to rename a few nested tables as below :

 

monojchakrab_0-1689159252457.png

I am using the following steps :

  • first have extracted the column headers
  • then taken the same to excel and added a column for renames

monojchakrab_1-1689159621480.png

 

  • Taken the excel table back to PQ
  • Used, table.renamecolumns ,

 

Table.AddColumn(#"Removed Columns1", "TableRenames", each Table.RenameColumns([ChangedFKHeaders],Table.ToRows(Headers),MissingField.Ignore))​

but :

 

bcos a few of the tables have the same column name, I am getting the followng error :

monojchakrab_2-1689159692492.png

Is there any fix for this unless I am missing something obvious?

any help appreciated

 

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @monojchakrab ,

 

This error is because you are adding a column named "value", but this column already exists in your table. You need to check your table to see if there is already a column named "value".

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

@v-stephen-msft - Stephen....that is what is confusing. The table returning the error does not actually contain any column with header as "Value"

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.

Top Solution Authors
Top Kudoed Authors