Forum Discussion

richard-powerbi's avatar
richard-powerbi
Post Patron
6 years ago
Solved

Dynamically rename columns from a column names table

Let's say I have a table with 3 columns: TableName, ColumnNameOld, ColumnNameNew. I create two functions that filter TableName to the table I want, and I keep either ColumnNameOld or ColumnNameNew a...
  • AlB's avatar
    6 years ago

    Hi richard-powerbi 

    im not sure i understand what exactly you need but perhaps List.Zip will be of help

    Table.RenameColumns(
    Source,
    List.Zip( {fOldColumnNames("TableName"), fNewColumnNames("TableName") } )
    )

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Contact me privately for support with any larger-scale BI needs

    Cheers