Forum Discussion

ExcelMonke's avatar
ExcelMonke
Icon for Impactful Individual rankImpactful Individual
2 years ago
Solved

Singe Select Slicer with Select All

I have a large data table with a column that returns two values based on an IF statement.   IF true THEN "Default" ELSE "Not Default"   What I would like to do is to create a slicer that on a si...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi ExcelMonke ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    (2)We can create a slicer table.

    Slicer = DATATABLE ( 
        "Column1", STRING, 
        {
            { "default" },
            { "all" }
        }
    )

    (3) We can create a measure and put it to the visual filter.

    Flag = 
    IF (
        ISFILTERED ( 'Slicer'[Column1] ),
        IF (
            OR (
                SELECTEDVALUE ( 'Slicer'[Column1] ) = "default"
                    && SELECTEDVALUE ( 'Table'[Column2] ) = "default",
                SELECTEDVALUE ( 'Slicer'[Column1] ) = "all"
            ),
            1,
            0
        ),
        1
    )

    (4) Then the result is as follows.

    Best Regards,

    Neeko Tang

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