Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Remove text in one specific cell in Power Query Editor

Hey fellow Power BI:ers I am very new to Power BI and am currently editing data in the Power Query editor to "wash it" prior to inserting it into Power BI. As seen in screenshot below I wish to em...
  • ImkeF's avatar
    ImkeF
    3 years ago

    Hi Anonymous ,
    thanks, that explanation would have made an excellent initial thread 😉

    To rename the first column dynamically, you can use this formula:

    Table.RenameColumns( #"Promoted Headers", {Table.ColumnNames(#"Promoted Headers"){0}, "Week"})

    So instead of hardcoding the column name, you grab its value by fetching the tables column names as list and and then grab the first element from the list {0} - with 0 as a positional index because the M-language is zero based.