Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi All,
I am trying to filter a dax query using a parameter value in PBI report builder. This works fine when I have the parameter inside the RSCustomDaxFilter function, but as soon as I try to use a parameter outside of that function I receive an error "The query contains the [parameter name] parameter, which is not declared.
I know it is as it works fine inside the dax filter function.
Below is the query. The parameter in question is @ReportingCostCentreReportingSegment, but I have also tried other parameters and using the parameters in different ways, but always the same error
EVALUATE
SUMMARIZECOLUMNS('GL Account'[Account Group 1], 'GL Account'[Account Group 2], 'GL Account'[Account Group 3],
'GL Account'[Account Group 4], 'GL Account'[Account Group 5], 'GL Account'[Account Group 6], 'GL Account'[GL Number]
, 'GL Account'[GL Name], 'GL Account'[GL Account], 'GL Account'[Account Type]
, RSCustomDaxFilter(@DateFinancialYear,EqualToCondition,[Date].[Financial Year],String)
, RSCustomDaxFilter(@ScenarioScenario,EqualToCondition,[Scenario].[Scenario],String)
, RSCustomDaxFilter(@DateMonth,EqualToCondition,[Date].[Month],String)
, RSCustomDaxFilter(@ReportingCostCentreReportingCode,EqualToCondition,[Reporting Cost Centre].[Reporting Code],String)
, RSCustomDaxFilter(@CountryCountry,EqualToCondition,[Country].[Country],String)
, RSCustomDaxFilter(@CompanyCompany,EqualToCondition,[Company].[Company],String)
, RSCustomDaxFilter(@CurrencyCurrency,EqualToCondition,[Currency].[Currency],String)
, RSCustomDaxFilter(@ReportingCostCentreReportingNonSegment,EqualToCondition,[Reporting Cost Centre].[Reporting Non-Segment],String)
, FILTER(VALUES('Reporting Cost Centre'.[Reporting Segment]), ('Reporting Cost Centre'.[Reporting Segment] = @ReportingCostCentreReportingSegment))
, FILTER(VALUES('GL Account'[Account Type]), ('GL Account'[Account Type] = "Income Statement"))
, FILTER(VALUES('Currency Format'[Currency Format]), ('Currency Format'[Currency Format] = "Currency Symbol"))
, "Actual", [Actual], "Budget", [Budget], "Forecast", [Forecast])
Thanks in advance for any help.
DAX pattern schematic that I use. No need to use RSCustomDaxFilter function
See your "All" with RSCustomDaxFilter function usage. My alternative via the link above.
To elaborate on the above, I have added an 'All' option to my parameter and I am trying to update the dax query to allow for this. If All is selected all rows should be returned, otherwise a filter based on the values selected in the parameter.
I was thinking something like the below.
RSCustomDaxFilter(@ReportingCostCentreReportingSegment,If(@ReportingCostCentreReportingSegment="All",NotEqualToCondition,EqualToCondition),[Reporting Cost Centre].[Reporting Segment],String)
But the query syntax is not accepted
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
9 |