Forum Discussion

Dicken's avatar
Dicken
Post Prodigy
1 year ago
Solved

Power Query conditional column selection

Hi , I wanted to select columns that contained a certain value and came up with this , but has anyone any ideas for a different approach ? here just selectign columns  that contian "X".  BTW, should...
  • PwerQueryKees's avatar
    1 year ago

    Your table = Source.

    You can use this anywhere you would normall use SelectColumns (or RemoveColumns)

     

    = Table.SelectColumns(Source,List.Select(Table.ColumnNames(Source), each Text.Contains(_, "X", Comparer.OrdinalIgnoreCase)))

     

    I made the match case INsenistive, remove the Comparare.OrdinalIgnoreCase if you don't want that.