Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Edit Variables as Slicer or dropdown for the user

Hi,

 

I am using HANA view as a data source for my Direct Query Power BI Desktop Report.

HANA View works on mandatory variables that need to be passed such as 'UNIT' in which the data will be calculated by the view.

In direct query mode i see 'Edit Variables' option under Edit queries to change the values of these variables.

Is there any option using which i can create a slicer or dropdown for the end user to change the values easily instead of going to Edit queries.

Also , is there any way by which we can change values of these variables after publishing report to Power BI Service.

 

Any suggestions

 

Thankyou in advance

 

Regards

Power BI User

 

  • Anonymous's avatar
    Anonymous
    8 years ago

    Anonymous,

    You have created a parameter named Unit, and define some values for it , right? If so, change {Cube.ApplyParameter,"UNIT",{'"&Unit&"'}} to the following:

    {Cube.ApplyParameter,"UNIT",{""&Unit&""}}

    Regards,
    Lydia

10 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous,

    Do you create parameters in Query Editor of Power BI Desktop? If so, do you use the paramter to filter your source or rows in your table? If you use the parameter to filter the rows, you may create measure instead. Please share sample data of your table and post expected result  based on sample data here.

    In addition , when you create parameter in Power BI Desktop, currently it is not possible to change the values of the parameter after publishing report to Power BI Service.

    Regards,
    Lydia

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thankyou for your response v-yuezhe-msft    :)

       

      I am not using Parameters. I am using Variables which appear by default when i connect with HANA Views in Direct Query mode as these variables are present in HANA Views.

       

           

       

      When i click on edit variables , this variable window opens. I can change values of the variables from here.

      My question is if we can make these variables available to user on the report itself as a list , slicer or dropdown for ease of use and so that when i publish my report to service these variables are available to user for changing values.

       

      Power BI User

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Anonymous,

        You would need to create parameters in Query Editor of Power BI Desktop for these variables, then apply these parameters into M code of your Query. This way, you can edit parameter values in dropdown list in Report view of Power BI Desktop, and you are able to change the parameter in Settings of Power BI Service.

        There is an example for your reference.


        Regards,
        Lydia

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi I am also facing the same issue and How to create the growth calculations in power bi Because I am using SAP HANA datasource direct query...?

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi

       

      I think you can use quick measure or create measure to create measures in Direct query mode as well.

       

       

      Regards

      Power BI User

  • Anonymous's avatar
    Anonymous
    Not applicable

    hi..just wondering how you manage to see the edit variables button? As mine is disable and grey out even though i use hana view direct query