Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
12 | |
10 | |
10 | |
10 |
User | Count |
---|---|
17 | |
15 | |
12 | |
11 | |
10 |