Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Remove multiple columns in Power Query

Hi, Is there a way to remove multiple columns in Power Query or do I need to remove one each time?   Based on the above image, i'm checking if the column exists, and if it does, I want to re...
  • AlexisOlson's avatar
    4 years ago

    You can intersect the list of columns you want to remove with the existing column names like this:

    = Table.RemoveColumns(
        RenamedColumns,
        List.Intersect(
            {
                Table.ColumnNames(RenamedColumns),
                {"UnitPrice", "TaxRate"}
            }
        )
    )