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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BeardyGeorge
Advocate I
Advocate I

setting "Allowed Values" for parameters with an SQL query

Hi,

 

Is there a way to define the list of allowed values for a parameter using an sql statement, rather than manually curating a list?

 

Many thanks,

 

George

1 ACCEPTED SOLUTION

Hi Eric

 

Thanks for getting back to me on this, but I don't think I explained clearly what I was trying to do, so unfortunately it doesn't really help.

 

Having done some digging it looks like what I'm trying to do will be in a future release (taken from here😞

 

Parameter Accepted Values: In addition to Data Type restrictions, users can apply further restrictions to the allowed values for a given parameter. For instance, users could specify that the Data Type for a parameter is Text and restrict the acceptable values to a static list of Text values. Users will then be able to pick one of these values when specifying the parameter value to use.  Currently, only a static list of Accepted Values (or any value of the expected type) are accepted. In future updates, we will enable users to bind the list of Accepted Values for a parameter to the output of another query.

View solution in original post

2 REPLIES 2
Eric_Zhang
Microsoft Employee
Microsoft Employee

@BeardyGeorge

 

Not 100% sure what is your point. Please check if this trick helps.

 

Capture.PNG

 

And in the advanced editor.

 

let
    Source = Sql.Database("servername", "testdb", [Query="select * from t1"&" where id in (" &valuelist& " )"])
in
    Source

Hi Eric

 

Thanks for getting back to me on this, but I don't think I explained clearly what I was trying to do, so unfortunately it doesn't really help.

 

Having done some digging it looks like what I'm trying to do will be in a future release (taken from here😞

 

Parameter Accepted Values: In addition to Data Type restrictions, users can apply further restrictions to the allowed values for a given parameter. For instance, users could specify that the Data Type for a parameter is Text and restrict the acceptable values to a static list of Text values. Users will then be able to pick one of these values when specifying the parameter value to use.  Currently, only a static list of Accepted Values (or any value of the expected type) are accepted. In future updates, we will enable users to bind the list of Accepted Values for a parameter to the output of another query.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.