Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 7 | |
| 5 | |
| 5 | |
| 3 |