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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JimJim
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
Responsive Resident
Responsive Resident

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.