Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Solved! Go to Solution.
@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
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
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...?
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,
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
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,
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
Hi Lydia,
Thankyou for your response 🙂
Since my dataset is huge i can't use import mode, i am using Direct Query Mode.
In direct query mode edit parameters option (Create Parameters) is disabled.
Although let me try using import mode if passing values to HANA variables is possible through parameters.
When i use import mode , we need to pass values to HANA View Variables to import Data.Therefore it generates the Mquery according to that.
Unit , Time_Frame and Material are HANA View Variables . Fro example 'kboe' is a value i passed to Unit variable to import data.I want to create a parameter for it , so i used :
{Cube.ApplyParameter,"UNIT",{'"&Unit&"'}}
where Unit is a Parameter.
It also does not seem to work for me.It does not do anything.
Please suggest
Regards
Kanika Jain
@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
Thanks a lot Lydia.
This solution worked for me :).
One of my Parameter is of type integer.
I am using the following syntax for passing parameter Year_Start
{Cube.ApplyParameter,"Year_Start",{"&Year_Start&"}},
This statement throws the following error below :
Can you please suggest
Regards
Power BI User
@Anonymous,
Please check my second reply in this thread. Create the Year_Start parameter in Text type, then use Number. FromText() function.
Regards,
Lydia
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |