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.
Hi Dicken
I'm afraid we cannot change how the dialog box works currently. Besides custom functions, for the built-in functions which contains a list parameter, it also requires choosing a column from a query when it's invoked by using UI. As of now, the UI is designed like this thus we cannot change its behavior. You will have to invoke it with M code manually instead of using the UI if you want to use a list for a parameter.
I find a similar request at Fabric Ideas forum, you can vote it up through the following link: Microsoft Idea: User-Defined Function Invocation Dialog Doesn't Fully Support List Parameters
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!