Forum Discussion

Neiners's avatar
Neiners
Icon for Helper II rankHelper II
1 year ago
Solved

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 m...
  • Anonymous's avatar
    Anonymous
    1 year ago

    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.

     

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

     

    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.

     

    Filtering:

     

     

    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.