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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Measure for a displaying a number in a table after selecting multiple values in a slicer

Hi,

 

I have a slicer with four selection options (critical,high,medium,low). Multiple selections in the same slicer can be selected at the same time. I need to create a measure for the following:

 

If only Critical is selected, a result of 1 is needed from the measure
If only High is selected, a result of 1 is needed from the measure
If High and Critical at the same time is selected, a result of 1 is needed from the measure
ALL other selected combinations need to display a 0 (for example selecting critical and high and medium at the same time should display a 0).

 

I tried creating the slicer with an IF function and through a SWITCH(TRUE(), function but I could not get the measure of selecting High and Critical at the same time working to display a 1. Which measure should I write?


Thank you for your feedback!

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

How about this?

 

OneOrZero =
VAR SlicerValues = VALUES ( Slicer[Option] )
VAR RemoveCritHigh = EXCEPT ( SlicerValues, { "Critical", "High" } )
RETURN
    IF ( ISEMPTY ( RemoveCritHigh ), 1, 0 )

 

 

This uses EXCEPT to remove "Critical" and "High" from the list of all selected options. If there are none left, the RemoveCritHigh variable is empty, which means that there are no selected options other than these two.

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

How about this?

 

OneOrZero =
VAR SlicerValues = VALUES ( Slicer[Option] )
VAR RemoveCritHigh = EXCEPT ( SlicerValues, { "Critical", "High" } )
RETURN
    IF ( ISEMPTY ( RemoveCritHigh ), 1, 0 )

 

 

This uses EXCEPT to remove "Critical" and "High" from the list of all selected options. If there are none left, the RemoveCritHigh variable is empty, which means that there are no selected options other than these two.

Anonymous
Not applicable

Works perfect, thank you!

Anonymous
Not applicable

PS I tried to create measures with the selectedvalue in the IF and SWITCH(TRUE(), as a test. 
However the following part of the measure, which I tried, does not work for me:
AND(Selectedvalue 1, Selectedvalue 2)     
or 
Selectedvalue 1 & Selectedvalue 2

Which measure would work that also after selecting high and critial at the same time, that a 1 is being displayed?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors