Search code examples
excelpowerquerym

How to select columns with the same pattern on Excel Power Query


I have multiple columns that its names ends with something like " - Hello" and " - Goodbye". So i tried using Table.SelectColumns with some kind of a regular expression to select all columns with this pattern.


Solution

  • = Table.SelectColumns(Source, List.Select(Table.ColumnNames(Source),
                          each Text.EndsWith(_," - Goodbye") or Text.EndsWith(_," - Hello")))