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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
captain_abhi
New Member

Multi select slicer work as AND operation.

Hi guys one query
 
states | categories
MH | water
MH | food
MH | IT
AP | IT
AP | food
KA | water
TS | IT
 
 
 i have one table in Power BI desktop in which i added a multi select slicer (water , food, IT ) and in default case if is select water and food then states will come like (MH ,MH , AP ,KA) , here Or operation is happed between multiselected value like water or food. But in my case I needed like water and food and output should be (MH, MH ) because MH is only state having both water and food.
 
How to do this

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @captain_abhi 

You can refer to the following solution.

Sample data 

vxinruzhumsft_0-1713922913707.png

Slicer table

vxinruzhumsft_1-1713922924839.png

Create the following measures.

Conbine = CONCATENATEX(FILTER(ALLSELECTED('Table'),[States] in VALUES('Table'[States])),[Categories],",")
Flag =
VAR _count =
    COUNTROWS (
        FILTER (
            VALUES ( SlicerTable[Categories] ),
            CONTAINSSTRING ( [Conbine], [Categories] )
        )
    )
RETURN
    IF (
        ISFILTERED ( SlicerTable[Categories] ),
        IF (
            _count = COUNTROWS ( VALUES ( SlicerTable[Categories] ) )
                && SELECTEDVALUE ( 'Table'[Categories] ) IN VALUES ( SlicerTable[Categories] ),
            1,
            0
        ),
        1
    )

Then put the flag measure to the visual filter.

vxinruzhumsft_2-1713923181195.png

Output

vxinruzhumsft_3-1713923215617.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @captain_abhi 

You can refer to the following solution.

Sample data 

vxinruzhumsft_0-1713922913707.png

Slicer table

vxinruzhumsft_1-1713922924839.png

Create the following measures.

Conbine = CONCATENATEX(FILTER(ALLSELECTED('Table'),[States] in VALUES('Table'[States])),[Categories],",")
Flag =
VAR _count =
    COUNTROWS (
        FILTER (
            VALUES ( SlicerTable[Categories] ),
            CONTAINSSTRING ( [Conbine], [Categories] )
        )
    )
RETURN
    IF (
        ISFILTERED ( SlicerTable[Categories] ),
        IF (
            _count = COUNTROWS ( VALUES ( SlicerTable[Categories] ) )
                && SELECTEDVALUE ( 'Table'[Categories] ) IN VALUES ( SlicerTable[Categories] ),
            1,
            0
        ),
        1
    )

Then put the flag measure to the visual filter.

vxinruzhumsft_2-1713923181195.png

Output

vxinruzhumsft_3-1713923215617.png

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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