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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Bharat7
Helper I
Helper I

Exclude Slicer Selection

Hi,
In my report there are 3 slicers-let it be Slicer1,Slicer2,Slicer3.
If I select values those should be excluded from the Visual/Report(All the values from three slicers).
Thanks in Advance.

@amitchandak @Greg_Deckler @AlexisOlson 

1 ACCEPTED SOLUTION

Ok, I have managed to test this.

Create a measure for to exclude each slicer selection. In this example:

Exclude Channel =
IF (
    ISFILTERED ( 'Exc Channel'[Channel] ),
    COUNTROWS (
        EXCEPT ( VALUES ( FactTable[Channel] ), VALUES ( 'Exc Channel'[Channel] ) )
    ),
    1
)
Exclude Item =
IF (
    ISFILTERED ( 'Exc Item'[Item] ),
    COUNTROWS ( EXCEPT ( VALUES ( FactTable[Item] ), VALUES ( 'Exc Item'[Item] ) ) ),
    1
)
Exclude REF =
IF (
    ISFILTERED ( 'Exc REF'[REF] ),
    COUNTROWS ( EXCEPT ( VALUES ( FactTable[REF] ), VALUES ( 'Exc REF'[REF] ) ) ),
    1
)

Add these measures to the filters for the visual in the filter pane and set the value to greater or equal to 1:

filter.JPGto get:

Exclude.gif

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

14 REPLIES 14
Bharat7
Helper I
Helper I

Thanks @amitchandak - I am using Independent slicers only. It is fine with one slicer but when I was trying with 2 or 3 slicers it's not working

 

Try:

Exclude =
VAR S1 = COUNTROWS (EXCEPT (VALUES(Table [Column1]), VALUES(Slicer1[Column1])))

VAR S2 = COUNTROWS (EXCEPT (VALUES(Table [Column2]), VALUES(Slicer2[Column2])))

VAR S3 = COUNTROWS (EXCEPT (VALUES(Table [Column3]), VALUES(Slicer3[Column3])))

RETURN

S1 + S2 + S3

 

add this measure to the filter for the visual in the filter pane and set the value to greater or equal to 1

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi @pauld -Thanks for the reply.
I tried that but It's not working

Ok, I have managed to test this.

Create a measure for to exclude each slicer selection. In this example:

Exclude Channel =
IF (
    ISFILTERED ( 'Exc Channel'[Channel] ),
    COUNTROWS (
        EXCEPT ( VALUES ( FactTable[Channel] ), VALUES ( 'Exc Channel'[Channel] ) )
    ),
    1
)
Exclude Item =
IF (
    ISFILTERED ( 'Exc Item'[Item] ),
    COUNTROWS ( EXCEPT ( VALUES ( FactTable[Item] ), VALUES ( 'Exc Item'[Item] ) ) ),
    1
)
Exclude REF =
IF (
    ISFILTERED ( 'Exc REF'[REF] ),
    COUNTROWS ( EXCEPT ( VALUES ( FactTable[REF] ), VALUES ( 'Exc REF'[REF] ) ) ),
    1
)

Add these measures to the filters for the visual in the filter pane and set the value to greater or equal to 1:

filter.JPGto get:

Exclude.gif

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi @PaulDBrown  When I use exclude item in visual filter for card visual it's not working.
Could you please help me with that?-That will be helpful for me to an extant.

You need to create a new measure for the card visual. In my example:

Sum of sales (Card Visual) =
CALCULATE (
    [Sum Sales],
    FILTER ( 'Dim Channel', [Exclude Dim Channel] >= 1 ),
    FILTER ( 'Dim Item', [Exclude Dim Item] >= 1 ),
    FILTER ( 'Dim REF', [Exclude Dim REF] >= 1 )
)

Exc22.gif

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi @PaulDBrown Thank you so much for the reply.
I think it works with single fact table-In my case I've multiple fact tables.
Any Idea/hint for multiple fact tables?

 

You can create the measures referencing the dimension tables instead of the fact table and use the dimension table fields in the visuals





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






 @PaulDBrown Thanks-but when I tried with dimension table the logic was not working

Using my previous example, these measures work with dimension tables:

The model
2 tables model.JPG

Exclude Dim Channel =
IF (
    ISFILTERED ( 'Exc Channel'[Channel] ),
    COUNTROWS (
        EXCEPT ( VALUES ( 'Dim Channel'[dChannel] ), VALUES ( 'Exc Channel'[Channel] ) )
    ),
    1
)
Exclude Dim Item =
IF (
    ISFILTERED ( 'Exc Item'[Item] ),
    COUNTROWS (
        EXCEPT ( VALUES ( 'Dim Item'[dItem] ), VALUES ( 'Exc Item'[Item] ) )
    ),
    1
)
Exclude Dim REF =
IF (
    ISFILTERED ( 'Exc REF'[REF] ),
    COUNTROWS ( EXCEPT ( VALUES ( 'Dim REF'[dREF] ), VALUES ( 'Exc REF'[REF] ) ) ),
    1
)

The visual is created with the fields from the dimension tables

Exc2.gif

 

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi @PaulDBrown Thanks for your support.Could you pls tell me how you derived those exclude tables - from fact table/dimension table? 

You can make a copy of the dimension tables (as long as they contain the unique values covering whole range of values in the model. You can create them by selecting "New table" under modeling and:

Excluded table = 'Dimension table'

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

@Bharat7 , to exclude, it is better to have an independent slicer, I discussed here

 

Need of an Independent Table in Power BI: https://youtu.be/lOEW-YUrAbE

Thanks @amitchandak - I am using Independent slicers only. It is fine with one slicer but when I am trying with 2 or 3 slicers it's not working

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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