March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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,
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
2 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
5 | |
4 | |
3 | |
3 | |
3 |