Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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!
Solved! Go to Solution.
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.
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.
Works perfect, thank you!
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?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.