Promoting Top Row

Hi

I want to Promote the top row of the attached image. However, that means the First Column would take n the name of eth Current first file in the Folder (Transform & Combine). The file may not always exist let alone be the first. What process do i use to keep the heading of the first column Source.Name

Thanks

Allister


Allister

Hi,
I may be wrong but as far as i know to stick with same name after making first row as col you have to do that manually.

Thanks,
Anurag

Hi @AllisterB,

I know the pain as I have faced similar issue. I implemented some solution to this problem using simple M-code . I will check and get back to you.

Kind Regards,
Hafiz

Hi @AllisterB,

Got it now :), you can use below M-code to rename after promoting first row to header. The second command which you are looking for is simply renaming column name whatever is present at column1(positioin0) regardless of the name of the file.

#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
#"Renamed Columns" = Table.RenameColumns(#"Promoted Headers",{{Table.ColumnNames(#"Promoted Headers"){0}, "Column_NewName"}}),

Please feel free to send your sample file in caseo of any issue. Cheers !!

2 Likes

Thanks =- works nicely

1 Like