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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.