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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

loop over multiple select slicer

Hi everyone 

Here is my problem. I have a table (LDM LIVE) with a summary,labels and description columns with a slicer (Part number) from another table (EPICOR LIVE). I need to find if the slicer value is found in the table summary. 

If just one selected value in the slicer is one I have no problems. I use the following dax measure and then filter with those who have a value of 1 

IsContained =
var _slicer= SELECTEDVALUE('EPICOR LIVE'[Part number])
var _currentRow=SELECTEDVALUE('LDM live'[Summary])
var _currentRow2=SELECTEDVALUE('LDM live'[Description])
var _currentRow3=SELECTEDVALUE('LDM live'[Labels])

RETURN
IF(FIND(_slicer,_currentRow,1, FIND(_slicer,_currentRow2,1,FIND(_slicer,_currentRow3,1,FALSE()))),1,0)

However if the slicer has multiple select values I couldn't find a way to do the same calculation. 
Can someone help please ?
2 ACCEPTED SOLUTIONS
tamerj1
Community Champion
Community Champion

Hi @Anonymous 
Please try

IsContained =
IF (
    NOT ISEMPTY (
        FILTER (
            'LDM live',
            NOT ISEMPTY (
                FILTER (
                    ALLSELECTED ( 'EPICOR LIVE'[Part number] ),
                    CONTAINSSTRING ( 'LDM live'[Summary], 'EPICOR LIVE'[Part number] )
                        || CONTAINSSTRING ( 'LDM live'[Description], 'EPICOR LIVE'[Part number] )
                        || CONTAINSSTRING ( 'LDM live'[Labels], 'EPICOR LIVE'[Part number] )
                )
            )
        )
    ),
    1
)

View solution in original post

@Anonymous 

Please try

IsContained =
IF (
    COUNTROWS ( ALLSELECTED ( 'EPICOR LIVE'[Part number] ) )
        <> COUNTROWS ( ALL ( 'EPICOR LIVE'[Part number] ) ),
    IF (
        NOT ISEMPTY (
            FILTER (
                'LDM live',
                NOT ISEMPTY (
                    FILTER (
                        ALLSELECTED ( 'EPICOR LIVE'[Part number] ),
                        CONTAINSSTRING ( 'LDM live'[Summary], 'EPICOR LIVE'[Part number] )
                            || CONTAINSSTRING ( 'LDM live'[Description], 'EPICOR LIVE'[Part number] )
                            || CONTAINSSTRING ( 'LDM live'[Labels], 'EPICOR LIVE'[Part number] )
                    )
                )
            )
        ),
        1
    )
)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@tamerj1 What if I don't want the table to show anything if nothing is selected in the slicer ? 

@Anonymous 

Please try

IsContained =
IF (
    COUNTROWS ( ALLSELECTED ( 'EPICOR LIVE'[Part number] ) )
        <> COUNTROWS ( ALL ( 'EPICOR LIVE'[Part number] ) ),
    IF (
        NOT ISEMPTY (
            FILTER (
                'LDM live',
                NOT ISEMPTY (
                    FILTER (
                        ALLSELECTED ( 'EPICOR LIVE'[Part number] ),
                        CONTAINSSTRING ( 'LDM live'[Summary], 'EPICOR LIVE'[Part number] )
                            || CONTAINSSTRING ( 'LDM live'[Description], 'EPICOR LIVE'[Part number] )
                            || CONTAINSSTRING ( 'LDM live'[Labels], 'EPICOR LIVE'[Part number] )
                    )
                )
            )
        ),
        1
    )
)
Anonymous
Not applicable

@tamerj1 It worked perfect. Thank you

tamerj1
Community Champion
Community Champion

Hi @Anonymous 
Please try

IsContained =
IF (
    NOT ISEMPTY (
        FILTER (
            'LDM live',
            NOT ISEMPTY (
                FILTER (
                    ALLSELECTED ( 'EPICOR LIVE'[Part number] ),
                    CONTAINSSTRING ( 'LDM live'[Summary], 'EPICOR LIVE'[Part number] )
                        || CONTAINSSTRING ( 'LDM live'[Description], 'EPICOR LIVE'[Part number] )
                        || CONTAINSSTRING ( 'LDM live'[Labels], 'EPICOR LIVE'[Part number] )
                )
            )
        )
    ),
    1
)

Helpful resources

Announcements
60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.