Forum Discussion

elz's avatar
elz
Advocate II
9 years ago
Solved

What is a list query for a parameter?

I was reading the July summary of new features (https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-july-feature-summary/) and near the bottom is a section for new query parameter features.

 

It indicates that the "Allowed Values" option can be set to Query and then select Query List from the Query drop-down list

 

My questions are 1) What is a query list

                            2) How do I create one

                            3) Why is the Query field drop down list on the parameters panel, not enabled.

 

I have the august update installed.

 

Any help would be greatly appreciated.

 

Thank you

Tracy

 

 

  • Hi Tracy,

     

    Query list is a list of values created in the blank query using M Language. It is basically the ordered list of values and defined using comma separated values with any data type enclosed in braces. 

    For example, Type the list of values of any data type in the advanced editor window.

    Remove all the code in Advanced Editor and just type below list of values

    {"Ryan","Matthew","Todd"} and Press Done.

     

    You can use this list of values in your parameter and this can be done by creating a new parameter and in the Suggested Values field, Select Query and Query field will become active now. You can select the current value as per your preference.

     

    This list of values will be shown in your parameter values.

     

    Hope this has clarified ypour understanding.

    For more information on this, Please visit this blog.

     

    Thanks & Regards,

    Bhavesh

     

     

     

     

7 Replies

  • Hi Tracy,

     

    Query list is a list of values created in the blank query using M Language. It is basically the ordered list of values and defined using comma separated values with any data type enclosed in braces. 

    For example, Type the list of values of any data type in the advanced editor window.

    Remove all the code in Advanced Editor and just type below list of values

    {"Ryan","Matthew","Todd"} and Press Done.

     

    You can use this list of values in your parameter and this can be done by creating a new parameter and in the Suggested Values field, Select Query and Query field will become active now. You can select the current value as per your preference.

     

    This list of values will be shown in your parameter values.

     

    Hope this has clarified ypour understanding.

    For more information on this, Please visit this blog.

     

    Thanks & Regards,

    Bhavesh

     

     

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes!

       

      And it is important to point out that this list can be dynamic and not just a manually typed in list--it can be based on any other query. See the blog link Bhavesh posted above for more details about that. 

    • elz's avatar
      elz
      Advocate II
      hi bhavesh,
      thank you - thank you - thank you!
      i was able to create the list query and use it.
      tracy
    • dstramilov's avatar
      dstramilov
      Helper II

      Is it possible to change parameters for posted report to Power BI?

  • Hi. 

    I created a query using the proposed solution described in the blog via "Add as a new query". When entering the parameter into my sql, i have an error message "Query 'Billed Labour' (Step 'Source') references other queries or steps, so it may not directly access a data source. please rebuild this data combination". 

    What i am trying to do: reduce the size of my dataset by allowing the user to select a few project number only to filter the dataset, hence reducing its size. The dataset is way too big too be loaded.

    I checked that using a "list of values" parameter type works fine.

    Thanks for your help

    JL