Forum Discussion
tt211595
2 years agoFrequent Visitor
Measure with rowwise IN operator
Hello! I am trying to create a measure that returns TRUE and FALSE for each row of a table based on a slicer selection. For example, say I have a table called MyTable with two columns named ID an...
- 2 years ago
Hi tt211595 - Create a table that contains all unique colors
uniquecolors = VALUES('MyTable'[Color])
create a measure and pass your uniquecolors :
MyMeasure =
VAR SelectedColors = VALUES('AllColors'[Color])
RETURN
IF(
SELECTEDVALUE('MyTable'[Color]) IN SelectedColors,
TRUE,
FALSE
)Ensures that the measure MyMeasure evaluates each row of MyTable and returns TRUE if the color is selected in the slicer otherwise FALSE
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
connect
2 years agoResolver I
Please use the following measure:
MyMeasure =
VAR SelectedColors = VALUES('AllColors'[Color])
RETURN
IF (
COUNTROWS (
FILTER (
SelectedColors,
SelectedColors =MyTable[Color]
)
) > 0,
TRUE,
FALSE
)