Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi guys,
I have a custom column with a function like this:
= if List.Contains(List, [Column1.1]) then [Index] else null
The List is a variable I created in a step within a query. Is there any way I can pass this list into a Parameter instead of a Step? It will be much easier for users to input different lists. The data type of Parameter does not include List, however.
Solved! Go to Solution.
Hi @Anonymous
You could create your parameter and require it to be text, and provide your users with a description that it must be comma separated. Presumably you'd also tell them this before they used the query.
You can then try to split the parameter into a list
TheList = Text.Split(TextList, ",")
You could wrap this in try..otherwise to catch errors or just let it fail naturally - but usually best to handle errors if you can.
You will also need to do any other parsing as required to check for invalid input.
https://docs.microsoft.com/en-us/powerquery-m/m-spec-error-handling
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Hi @Anonymous
You could create your parameter and require it to be text, and provide your users with a description that it must be comma separated. Presumably you'd also tell them this before they used the query.
You can then try to split the parameter into a list
TheList = Text.Split(TextList, ",")
You could wrap this in try..otherwise to catch errors or just let it fail naturally - but usually best to handle errors if you can.
You will also need to do any other parsing as required to check for invalid input.
https://docs.microsoft.com/en-us/powerquery-m/m-spec-error-handling
Regards
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Thanks Philip, wonderful solution!