Forum Discussion

ashukla2's avatar
ashukla2
Regular Visitor
3 years ago
Solved

Best way to modify parameters for advanced editor

I have a SQL database that I generate new queries for through the Advanced Editor. To get some customability in the query, I created a couple parameters and reference those in the advanced editor. However, to change the value of the parameter I have to open Transform Data and change them in there. How can I set up my dashboard so the user can change the parameter directly from the dashboard and not open transform data (and the resulting SQL query would be updated as well)? Thanks!

  • Hi ashukla2 ,

     

    If you want to bind a parameter, you need to under DirectQuery mode:

    Besides, you should check if your query use your parameter correctly.

    Here is my example:

    When I change the parameter in power query, the data of TESTTABLE will change accordingly:

     

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

     

3 Replies

  • Hi ashukla2 ,

     

    To allow users to change parameters directly from the Power BI dashboard, you can use slicers. Slicers allow users to filter data in visuals based on their selections. You can bind your parameter to a table field and use a slicer to control it.

    Here is a document about this:

    Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

    Note: To work through these procedures, you must have a valid M query that uses one or more DirectQuery tables.

     

    Best Regards,

    Jianbo Li

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • ashukla2's avatar
      ashukla2
      Regular Visitor

      I followed the steps, however I after I bind a parameter to a set of values and make a slicer for it. When I change the value of the slicer, the parameter is not changing. I've read that the query needs to be a DirectQuery, but regardless of that shouldn't the actual parameter that I bound to change as well when I preview it under 'Transform Data'? The parameter stays as the default value I set it to.

      • v-jianboli-msft's avatar
        v-jianboli-msft
        Icon for Community Support rankCommunity Support

        Hi ashukla2 ,

         

        If you want to bind a parameter, you need to under DirectQuery mode:

        Besides, you should check if your query use your parameter correctly.

        Here is my example:

        When I change the parameter in power query, the data of TESTTABLE will change accordingly:

         

        Best Regards,

        Jianbo Li

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.