Forum Discussion
Power Query Custom Function how to select a list
- 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.
not sure what you mean by ' select' it.
Guessing: You can call a function from anothe query of function with its name and the parameter in parenthesis.
In your case something like
rplace =
{ { "cat", "CAT"}, {"cow", "COW"}}
= replaceallmatching(Source, rplace )assuming you named your function replaceallmatching
What I mean is choose it form the invoke dialog box when you click/ select / choose a funtion a dialog box opens, form there ( x as table)=> you can choose a table , so I want to choose my replacement list in the same manner, so ( table as table, replacement list as ? ) => list does work as that askes for a table column, you cannot type the name in as that = text, so the only way so far is to just do it manually
-= functionName( tablename, listname), but is there a way to use the dialog box ,