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
Anonymous
Not applicable

Limit slicer based on multiple slicers

Hi,

I've built 4 identical slicers each with different types of cancer a person can have across their lifetime. The full list has 10 cancer types and would like subsequent slicers to only have the option to select those not already chosen from previous slicers. At the moment I can incorrectly select the same cancers across all 4 slicers. can you assist? 

 

pic.JPGpic2.png

2 ACCEPTED SOLUTIONS
PaulDBrown
Community Champion
Community Champion

For the slicers to be mutually exclusive, you need to create a measures to use in each slicer as a filter in the filter pane, following this (CT Slicer * is the name of each table used as slicers):

 

Filter 1 = 
VAR S1 = 'CT Slicer 1'
VAR S2 = 'CT Slicer 2'
VAR S3 = 'CT Slicer 3'
VAR S4 = 'CT Slicer 4'
VAR SelectedCT = 
DISTINCT(
    UNION(S2, S3, S4))
    RETURN
COUNTROWS(
    EXCEPT(S1,SelectedCT))
Filter 2 = 
VAR S1 = 'CT Slicer 1'
VAR S2 = 'CT Slicer 2'
VAR S3 = 'CT Slicer 3'
VAR S4 = 'CT Slicer 4'
VAR SelectedCT = 
DISTINCT(
    UNION(S1, S3, S4))
    RETURN
COUNTROWS(
    EXCEPT(S2, SelectedCT))
Filter 3 = 
VAR S1 = 'CT Slicer 1'
VAR S2 = 'CT Slicer 2'
VAR S3 = 'CT Slicer 3'
VAR S4 = 'CT Slicer 4'
VAR SelectedCT = 
DISTINCT(
    UNION(S1,S2,S4))
    RETURN
COUNTROWS(
    EXCEPT(S3,SelectedCT))
Filter 4 = 
VAR S1 = 'CT Slicer 1'
VAR S2 = 'CT Slicer 2'
VAR S3 = 'CT Slicer 3'
VAR S4 = 'CT Slicer 4'
VAR SelectedCT = 
DISTINCT(
    UNION(S1,S2,S3))
    RETURN
COUNTROWS(
    EXCEPT(S4,SelectedCT))

 

Now add each measure to the filter pane for each corresponding slicer. Before you set the filter, select a  different value for each slicer

Then set the value of each measure  in each filter to = 1.

f4slicers.gif

 

I've attached the sample PBIX file

 

 





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

Anonymous
Not applicable

This is brilliant. Just bedded this into my dashboard and works a treat. Many thanks Paul.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

This is brilliant. Just bedded this into my dashboard and works a treat. Many thanks Paul.

PaulDBrown
Community Champion
Community Champion

For the slicers to be mutually exclusive, you need to create a measures to use in each slicer as a filter in the filter pane, following this (CT Slicer * is the name of each table used as slicers):

 

Filter 1 = 
VAR S1 = 'CT Slicer 1'
VAR S2 = 'CT Slicer 2'
VAR S3 = 'CT Slicer 3'
VAR S4 = 'CT Slicer 4'
VAR SelectedCT = 
DISTINCT(
    UNION(S2, S3, S4))
    RETURN
COUNTROWS(
    EXCEPT(S1,SelectedCT))
Filter 2 = 
VAR S1 = 'CT Slicer 1'
VAR S2 = 'CT Slicer 2'
VAR S3 = 'CT Slicer 3'
VAR S4 = 'CT Slicer 4'
VAR SelectedCT = 
DISTINCT(
    UNION(S1, S3, S4))
    RETURN
COUNTROWS(
    EXCEPT(S2, SelectedCT))
Filter 3 = 
VAR S1 = 'CT Slicer 1'
VAR S2 = 'CT Slicer 2'
VAR S3 = 'CT Slicer 3'
VAR S4 = 'CT Slicer 4'
VAR SelectedCT = 
DISTINCT(
    UNION(S1,S2,S4))
    RETURN
COUNTROWS(
    EXCEPT(S3,SelectedCT))
Filter 4 = 
VAR S1 = 'CT Slicer 1'
VAR S2 = 'CT Slicer 2'
VAR S3 = 'CT Slicer 3'
VAR S4 = 'CT Slicer 4'
VAR SelectedCT = 
DISTINCT(
    UNION(S1,S2,S3))
    RETURN
COUNTROWS(
    EXCEPT(S4,SelectedCT))

 

Now add each measure to the filter pane for each corresponding slicer. Before you set the filter, select a  different value for each slicer

Then set the value of each measure  in each filter to = 1.

f4slicers.gif

 

I've attached the sample PBIX file

 

 





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.






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.