Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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