Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi guys,
I am trying to add a parameter in my report and add the parameter in the query designer module.
The query was generated within Power BI via Performance analyser.
I saw different posts on this issue but no clear solution.
First I have tried to create a parameter in the report (in my dataset properties) and add it with @ in my query such as
// DAX Query
DEFINE
VAR __DS0FilterTable =
TREATAS({@Test}, 'FACT - Conflicts'[Conflict category])
However, I have an error message that the parameter @test was not declared.
So I declared it again through "Query Parameters" module within the query designer (same name and another name).
This time I can execute the query but it returns no row with a default value "Group" (which should not be the case - if I had put TREAT({"Group"}, it returns some rows).
I tried to see what were the values in the Parameters properties window and I can see this.
Which I don't understand because "Test" is not the name of my dataset..
Any idea to resolve this?
Thanks a lot in advance!
Solved! Go to Solution.
Hi all,
I was able to find a solution to my problem (that raised other problems which I solved as well).
What I was trying to do:
- Use a DAX query (created by Power Bi Desktop) into Power BI Report Builder but modify it to insert some parameters that I could use in my report in Power BI Report Builder.
- The is the different steps I have done (for a multi-value parameter):
// DAX Query DEFINE VAR __DS0FilterTable = TREATAS({"Entity"}, 'DIM_Legal_Entities'[Legal_Entity])
VAR __DS0FilterTable = CALCULATETABLE('FACT_Conflicts',PATHCONTAINS(@Legal_Entities,DIM_Legal_Entities[Legal_Entity]))
These are the articles that helped me to understand:
Hope it will help someone!
Best,
Hi @loicr ,
I need your help in this similar use case which I'm currently working on. I'm not clear on how to make the parameters work. Should I need to add Report Parameters first and then create a Dataset where in the Query Designer do I need to add the query parameters separately? If so, how should I associate the Report and Query parameters? Please assist here.
Hi all,
I was able to find a solution to my problem (that raised other problems which I solved as well).
What I was trying to do:
- Use a DAX query (created by Power Bi Desktop) into Power BI Report Builder but modify it to insert some parameters that I could use in my report in Power BI Report Builder.
- The is the different steps I have done (for a multi-value parameter):
// DAX Query DEFINE VAR __DS0FilterTable = TREATAS({"Entity"}, 'DIM_Legal_Entities'[Legal_Entity])
VAR __DS0FilterTable = CALCULATETABLE('FACT_Conflicts',PATHCONTAINS(@Legal_Entities,DIM_Legal_Entities[Legal_Entity]))
These are the articles that helped me to understand:
Hope it will help someone!
Best,
Hi @loicr ,
Please try to add paramters like so:
Reference:
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Great post thanks! Just wanted to comment on @param if connecting to Oracle it is :Param
Hi @Icey ,
Thanks for your input, however, this does not solve my issue.
As explained, I know how to add a parameter and did it several times.
The example you displayed relates to SQL where I want to add my parameter in a DAX query (copied from Power BI).
Best,
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.