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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
ExcelMonke
Super User
Super User

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 single click:

  1. Filters to all "Default" values
  2. Return all values are returned that are both "Default" AND "Not Default"

I've been playing around with Switch and IF functions and am not able to figure this one out. Any help is appreciated!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @ExcelMonke ,

 

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

(1) This is my test data. 

vtangjiemsft_0-1699947116756.png

(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.

vtangjiemsft_1-1699947330665.png

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. 

View solution in original post

4 REPLIES 4
v-tangjie-msft
Community Support
Community Support

Hi @ExcelMonke ,

 

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

(1) This is my test data. 

vtangjiemsft_0-1699947116756.png

(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.

vtangjiemsft_1-1699947330665.png

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. 

Thank you. Do you add the DATATABLE slicer as a measure or a new column?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @ExcelMonke ,

 

It is as a slicer table. 

vtangjiemsft_0-1700011343698.pngvtangjiemsft_1-1700011371611.png

 

vtangjiemsft_2-1700011386736.png

The [column1] field of this table is then used as a slicer. Or you can create the slicer table manually by clicking enter data in the home tab.

 

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. 

FreemanZ
Super User
Super User

hi @ExcelMonke ,

 

For a slicer, selecting no item is the same as selecting every item. 

 

If this is not relevant, could you elaborate your expectation, ideally with dataset and corresponding expected result?

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors