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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
rohitkushwaha
New Member

Filter based on multiple selection in the slicer where measure is used

Hi,
I want to filter based on selection in the slicer (multiple selection should work). Right now the measure is working only for a single selection, if I select multiple options then it doesn't filter.
I'm using Service_slicer to filter Service_column.

Service_column:

rohitkushwaha_0-1709632680449.png

Service_slicer:

rohitkushwaha_1-1709632744464.png

Measure:

 

 

Result = 
VAR SelectedValues = VALUES(Services_slicer[Services])
VAR Delimiter = ","

RETURN
    IF (
        COUNTROWS(
            FILTER (
                PBI_restaurants_in_India,
                CONTAINSSTRING(
                    SUBSTITUTE(PBI_restaurants_in_India[Services], Delimiter, "|"),
                    SELECTEDVALUE(Services_slicer[Services])
                )
            )
        ) > 0,
        1,
        0
    )

 

 

 Filter Pane:

rohitkushwaha_2-1709632964437.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @rohitkushwaha ,

First create a mid table in powerquery:

vcgaomsft_0-1709691890424.png

And then please create a measure like:

Result2 = 
VAR __selected_values = ALLSELECTED('Services_slicer'[Services])
VAR __cur_services = VALUES('PBI_restaurants_in_India'[Services])
VAR __selected_values_count = COUNTROWS(__selected_values)
VAR __services = CALCULATETABLE(VALUES('Services_slicer_2'[Services]),TREATAS(__selected_values,'Services_slicer_2'[Services2]))
VAR __services_count = CALCULATE(COUNTROWS('Services_slicer_2'),TREATAS(__selected_values,'Services_slicer_2'[Services2]),TREATAS(__cur_services,'Services_slicer_2'[Services]))
VAR __filter = IF(SELECTEDVALUE('PBI_restaurants_in_India'[Services]) IN __services && __services_count = __selected_values_count, 1)
RETURN
__filter

And apply it to the visuals filter.
Output:

vcgaomsft_1-1709691996137.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

In the Power Query Editor, split the contents of that column into rows using the comma delimiter.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @rohitkushwaha ,

First create a mid table in powerquery:

vcgaomsft_0-1709691890424.png

And then please create a measure like:

Result2 = 
VAR __selected_values = ALLSELECTED('Services_slicer'[Services])
VAR __cur_services = VALUES('PBI_restaurants_in_India'[Services])
VAR __selected_values_count = COUNTROWS(__selected_values)
VAR __services = CALCULATETABLE(VALUES('Services_slicer_2'[Services]),TREATAS(__selected_values,'Services_slicer_2'[Services2]))
VAR __services_count = CALCULATE(COUNTROWS('Services_slicer_2'),TREATAS(__selected_values,'Services_slicer_2'[Services2]),TREATAS(__cur_services,'Services_slicer_2'[Services]))
VAR __filter = IF(SELECTEDVALUE('PBI_restaurants_in_India'[Services]) IN __services && __services_count = __selected_values_count, 1)
RETURN
__filter

And apply it to the visuals filter.
Output:

vcgaomsft_1-1709691996137.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

rohitkushwaha
New Member

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors