Forum Discussion
Parameter in Power BI report Builder
Hello CeeVee33
When you copy DAX from Performance Analyzer into Power BI Report Builder for paginated reports, parameters are not automatically recognized from the DAX text. Even with correct DAX syntax (such as using TREATAS or RSCustomDaxFilter), Report Builder will display a “parameter not declared” error unless the parameter is manually created at the dataset level.
To use parameters with Performance Analyzer DAX:
Create the parameter as a Dataset Parameter (Dataset Properties → Parameters).
Map the dataset parameter to a Report Parameter.
Once mapped, you can reference the parameter in the DAX query using @ParameterName.
Just pasting Performance Analyzer DAX and adding @ParameterName won't work, since paginated reports do not detect parameters from DAX text. This is the expected behavior for paginated reports that use Power BI semantic models, which explains why the same DAX works in Power BI Desktop visuals but not in Report Builder unless the dataset parameter is explicitly defined.
Regards,
ABD.
Thank you ABD128 for the response.
I did those steps, I believe it is mentioned in one of the links I pasted.
However, when I do the 3rd step of refrerencing the parameter in the DAX - I get below error.
The query contains the 'calendardate' parameter, which is not declared.
And I guess that is where I am stuck. All those links talk about using it as above, but still not successful at my end.
Also, someone said dont go into the query designer and just do it in the text editor of data set. I tried it too, but same error as above.
Someone said paste in design mode of query designer then hit the "@" sign on the top which is for parameter and add it. But then it does not appear in the DAX. So where did it go?
Any help is much appreciated.
- ABD1285 months agoResolver II
Hi CeeVee33
Thank you for confirming the steps. From your description, it doesn’t seem to be a DAX syntax issue or related to Performance Analyzer. The error "The query contains the 'calendardate' parameter, which is not declared" happens during validation, showing that Report Builder doesn’t recognize the parameter at the dataset level, even if it looks correctly set up in the UI. That’s why manually adding @calendardate, using TREATAS or RSCustomDaxFilter, or switching between Query Designer and text mode doesn’t fix it the parameter isn’t bound internally.
To fix this, try rebuilding the setup: delete the dataset and any related parameters, then recreate the report parameter (calendardate as Date/Time) and add it under Dataset Properties → Parameters with the mapping =Parameters!calendardate.Value. You can check the binding with a simple query like EVALUATE ROW("Test", @calendardate). If the error still shows up, it confirms the problem is with dataset parameter binding, not the DAX logic, and recreating the dataset is needed. Your approach is correct, but the main issue is the parameter isn’t recognized internally by the dataset.
Regards,
ABD