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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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