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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors