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
JimJim
Post Patron
Post Patron

Paginated Report - cascading parameters

Hi Guys,

 

I have a dataset for my Region parameter, defined as follows:

 

EVALUATE VALUES ('Business Hierarchy'[Region])

 

I also have a dataset for my Area parameter and failing to filter based on the Region selection. I am trying the below:

 

EVALUATE SUMMARIZECOLUMNS ( 'Business Hierarchy'[Area], FILTER ( 'Business Hierarchy', [Business Hierarchy].[Region] IN @region ) )

 

But getting error "The function expects a table expression for argument '2', but a string or numeric expression was used."... How do I change @region to a table type?

 

Edit: The following DAX works when a single value in Region is selected, but doesn't work when multiple values are selected

 

EVALUATE
CALCULATETABLE(
SUMMARIZECOLUMNS ( 'Business Hierarchy'[Area]),
'Business Hierarchy'[Region]=@Region)

1 ACCEPTED SOLUTION
JimJim
Post Patron
Post Patron

I worked it out, adding the solution here in case anyone else needs it.

 

The query for your dataset that your param uses should be like this:

 

DEFINE
VAR r =
FILTER (
VALUES ( 'Business Hierarchy'[Region] ),
PATHCONTAINS ( @region, 'Business Hierarchy'[Region] ) )

EVALUATE
SUMMARIZECOLUMNS ( 'Business Hierarchy'[Area], r )

 

Then in the parameters section, for parameter value choose the expression and use the following format:

 

=Join(Parameters!MyParameter.Value,"|")

View solution in original post

2 REPLIES 2
Daniel29195
Super User
Super User

@JimJim 

hello, 

in summarizecolumns you should use the full expression to filter data 

 

 

EVALUATE
CALCULATETABLE(
        SUMMARIZECOLUMNS ( 'Business Hierarchy'[Area]),
        filter(
             all('Business Hierarchy'),

             Business Hierarchy'[Region]=@Region

         )

 

 

 

 

If my response has successfully addressed your issue kindly consider marking it as the accepted solution! This will help others find it quickly. Dont forget to hit that  thumbs up button 🫡👍

JimJim
Post Patron
Post Patron

I worked it out, adding the solution here in case anyone else needs it.

 

The query for your dataset that your param uses should be like this:

 

DEFINE
VAR r =
FILTER (
VALUES ( 'Business Hierarchy'[Region] ),
PATHCONTAINS ( @region, 'Business Hierarchy'[Region] ) )

EVALUATE
SUMMARIZECOLUMNS ( 'Business Hierarchy'[Area], r )

 

Then in the parameters section, for parameter value choose the expression and use the following format:

 

=Join(Parameters!MyParameter.Value,"|")

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.