Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

How to use parameter as a dynamic list

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.

 

List.PNG

 

1 ACCEPTED SOLUTION
PhilipTreacy
Super User
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.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
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.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Thanks Philip, wonderful solution!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors