Forum Discussion
Dicken
2 years agoPost Prodigy
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...
- 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.
Dicken
2 years agoPost Prodigy
Ok, last try,
I create a custom function, and when you select that function you get to choose input parameters,
so my fiirt is a table, this can be chosen form a drop down list of avialable tables, so in the doalog box
(atable as table, oldnew as list) =>
how do I choose the list, as it now asks for a table column?
dufoq3
2 years agoCommunity Champion
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.