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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Neiners
Helper II
Helper II

use multiple (multiple select) slicers to filter a table but have none selected as an option

Hi-

I have multiple slicers (around 20 on a slicer panel) for a table visual. The slicers are all disconnected tables. What I would like to be able to do is have a user be able to filter on one or more of the slicers to filter the table visual down to their needs. The problem that I am running into, is that if any of the slicers are not selected, it is defaulting to all selected. When I am dropping the measure into the table visual and setting it to greater than or equal to 1, it is returning no results. I have tried multiple combinations but nothing is getting the results that I want. I also want to note that the slicer value may not be an exact match, so I am attempting to search using containsstring or find, etc...The closest that I have gotten is: 

slicerfilter =

IF(MAX(table[column1] IN ALLSELECTED[slicer1[slicer1] &&

IF(MAX(table[column2] IN ALLSELECTED[slicer2[slicer2] &&

IF(MAX(table[column3] IN ALLSELECTED[slicer3[slicer3] &&

IF(MAX(table[column4] IN ALLSELECTED[slicer4[slicer4])

//continue for remainder slicers

,1,0)

 

I have also tried but this method is only searching within one column of the table and I need to search across multiple columns depending on the slicer selected. Each slicer is for a different column in the table. 

var _slicer1 = FILTER(VALUES(slicer1[slicer1]), ISFILTERED(slicer1[slicer1]))

var _slicer2 = FILTER(VALUES(slicer2[slicer2]), ISFILTERED(slicer2[slicer2]))

//continue for remainder slicers

var _selectedslicers = UNION(_slicer1, _slicer2)

var _matchingslicervalues = 

ADDCOLUMNS(Table,

"@ISMatched",

var _textvalue = SELECTEDVALUE(table[key])

//the key is a calculated column that combines the columns of the possible slicer selections example:  slicer1value|slicer2value

RETURN

SUMX(FILTER(_selectedslicers, CONTAINSSTRING(_textvalue, [slicer1])),1))

var _countofselectedvalues = COUNTROWS(_selectedslicers)

var _matchingexactslicervalues = FILTER(_matchingslicervalues, [@IsMatched] = _countofselectedvalues)

RETURN

IF(

NOT(ISFILTERED(slicer1[slicer1])) &&

NOT(ISFILTERED(slicer2[slicer2])), BLANK(),

SUMX(_matchingexactslicervalues, [@IsMatched]))

 

 

 

1 ACCEPTED SOLUTION

Hi @Neiners ,

Thanks for the follow-up.

The behavior you're seeing where everything shows 1 by default and turns to 0 on slicer selection suggests that SELECTEDVALUE or direct column references inside CONTAINSSTRING might not be resolving row by row in the visual. This usually happens when the FilterFlag measure is placed directly into the visual-level filter without an iterator to force evaluation per row.

 

To address this, I reproduced your scenario with disconnected slicers, partial text matching, and a table visual that should respect slicer filters only when selections are made.

 

Steps Taken to Repro:
1. Created a table TableData with columns Column1, Column2.

vveshwaramsft_0-1748963010752.png

 

2. Created disconnected slicer tables Slicer1, Slicer2, each with sample values.

vveshwaramsft_1-1748963099959.pngvveshwaramsft_2-1748963146597.png

 

3. Used CONTAINSSTRING to match text in each slicer to the respective columns and wrapped everything inside SUMX(TableData, ...) to force row-wise evaluation.

FilterFlag = 
SUMX (
    TableData,
    VAR _s1Match =
        IF (
            ISFILTERED(Slicer1[SlicerValue]),
            MAXX (
                FILTER (
                    Slicer1,
                    CONTAINSSTRING ( TableData[Column1], Slicer1[SlicerValue] )
                ),
                1
            ),
            1
        )
    VAR _s2Match =
        IF (
            ISFILTERED(Slicer2[SlicerValue]),
            MAXX (
                FILTER (
                    Slicer2,
                    CONTAINSSTRING ( TableData[Column2], Slicer2[SlicerValue] )
                ),
                1
            ),
            1
        )
    RETURN
        IF (_s1Match * _s2Match = 1, 1, 0)
)

 

4. Applied FilterFlag = 1 in the visual-level filter for the table visual.

vveshwaramsft_3-1748963256557.png

 

Filtering:

vveshwaramsft_4-1748963336225.png

 

 

Hope this helps. Please reach out for further assistance.

If you continue to face issues, feel free to share a small PBIX file (with sensitive data removed), and we can take a closer look.


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


Thank you.

 

Attaching .pbix file for reference.

 

View solution in original post

5 REPLIES 5
v-veshwara-msft
Community Support
Community Support

Hi @Neiners ,
Thanks for reaching out to Microsoft Fabric Community.

Below is a general pattern that supports multiple disconnected slicers (each mapped to a different column), allowing partial text match filtering while treating no selection as no filter:

FilterFlag :=
VAR _s1Match =
    IF (
        ISFILTERED(Slicer1[SlicerValue]),
        CALCULATE (
            MAXX (
                FILTER (
                    Slicer1,
                    CONTAINSSTRING ( SELECTEDVALUE ( Table[Column1], "" ), Slicer1[SlicerValue] )
                ),
                1
            ),
            REMOVEFILTERS ( Table )
        ),
        1
    )

VAR _s2Match =
    IF (
        ISFILTERED(Slicer2[SlicerValue]),
        CALCULATE (
            MAXX (
                FILTER (
                    Slicer2,
                    CONTAINSSTRING ( SELECTEDVALUE ( Table[Column2], "" ), Slicer2[SlicerValue] )
                ),
                1
            ),
            REMOVEFILTERS ( Table )
        ),
        1
    )

-- Extend this pattern for additional slicers

RETURN
IF (
    _s1Match * _s2Match = 1,
    1,
    0
)

This measure can be added to the visual-level filters pane and set to show rows where the value equals 1.

 

Related thread for reference:
Use slicer from disconnected table to filter chart... - Microsoft Fabric Community

 

If further help is needed, feel free to share a sample dataset or .pbix file (with any sensitive info removed) so we can assist more precisely.

 

Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to give a kudos and Accept as the solution to help the other members find it more quickly.


Thank you.

This is resulting in everything returning a 1. As soon as a slicer value is selected, everything changes to a 0. I have only tested this with 2 of the slicers and same results no matter if I select, one slicer or both slicers.

Hi @Neiners ,

Thanks for the follow-up.

The behavior you're seeing where everything shows 1 by default and turns to 0 on slicer selection suggests that SELECTEDVALUE or direct column references inside CONTAINSSTRING might not be resolving row by row in the visual. This usually happens when the FilterFlag measure is placed directly into the visual-level filter without an iterator to force evaluation per row.

 

To address this, I reproduced your scenario with disconnected slicers, partial text matching, and a table visual that should respect slicer filters only when selections are made.

 

Steps Taken to Repro:
1. Created a table TableData with columns Column1, Column2.

vveshwaramsft_0-1748963010752.png

 

2. Created disconnected slicer tables Slicer1, Slicer2, each with sample values.

vveshwaramsft_1-1748963099959.pngvveshwaramsft_2-1748963146597.png

 

3. Used CONTAINSSTRING to match text in each slicer to the respective columns and wrapped everything inside SUMX(TableData, ...) to force row-wise evaluation.

FilterFlag = 
SUMX (
    TableData,
    VAR _s1Match =
        IF (
            ISFILTERED(Slicer1[SlicerValue]),
            MAXX (
                FILTER (
                    Slicer1,
                    CONTAINSSTRING ( TableData[Column1], Slicer1[SlicerValue] )
                ),
                1
            ),
            1
        )
    VAR _s2Match =
        IF (
            ISFILTERED(Slicer2[SlicerValue]),
            MAXX (
                FILTER (
                    Slicer2,
                    CONTAINSSTRING ( TableData[Column2], Slicer2[SlicerValue] )
                ),
                1
            ),
            1
        )
    RETURN
        IF (_s1Match * _s2Match = 1, 1, 0)
)

 

4. Applied FilterFlag = 1 in the visual-level filter for the table visual.

vveshwaramsft_3-1748963256557.png

 

Filtering:

vveshwaramsft_4-1748963336225.png

 

 

Hope this helps. Please reach out for further assistance.

If you continue to face issues, feel free to share a small PBIX file (with sensitive data removed), and we can take a closer look.


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


Thank you.

 

Attaching .pbix file for reference.

 

Thank You! Thank You! and Thank You again! It has worked for up to 3 slicers with multiple selections on each slicer. This is a game changer for me.

You're very welcome! Great to hear it worked well for your scenario.

To add more slicers, just extend the same pattern using additional ISFILTERED and CONTAINSSTRING checks for each one.

Let us know if you need any further assistance.

Thanks again for confirming.

Please continue using the Fabric Community for any future queries - we're happy to help.

 

Best Regards,
Vinay
Community Support Team

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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