Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join 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.

Reply
Craig_Donoghue
Frequent Visitor

Report Builder - declare parameters

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.

 

2 REPLIES 2
garythomannCoGC
Impactful Individual
Impactful Individual

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.

Craig_Donoghue
Frequent Visitor

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.