Forum Discussion

Dicken's avatar
Dicken
Post Prodigy
2 years ago
Solved

Power Query Custom Function how to select a list

 HI,     Is it possible to select a list the same way you can a table when creating a custom function,   so starting pont;   nested list old / new values;  rplace = { { "cat", "CAT"}, {"cow", "C...
  • dufoq3's avatar
    dufoq3
    2 years ago

    Check this:

     

    = (myTable as table, column as text)=>
            Table.TransformColumns(myTable, {{column, each Text.Combine(List.ReplaceMatchingItems(Text.Split(_, " "), {{"cat", "CAT"}, {"dog", "DOG"}}), " ")}})

     

    Now you can invoke this function by selecting a table with dropdown list and entering Column Name as text.