Forum Discussion
Anonymous
2 years agoNot applicable
Slicer Using Measure Based on Criteria
Hi, Is it possible for a slicer to accommodate a measure based on criteria e.g. the screenshot showed criteria for Negative Variance, Negative Variance with No Sales, etc? //NT ...
Anonymous
2 years agoNot applicable
Hi,
I created the filter as shown.
I'm also sharing you the dax i created for the filter flag
Filter Flag =
VAR CurrentClassification = gbkmut_pns_drd[Comment_drd]
VAR CurrentSelection = SELECTEDVALUE('Filter Comment'[Selection])
RETURN
SWITCH(
TRUE(),
CurrentSelection = "Negative Variance" && CurrentClassification = "Negative Variance",1,
CurrentSelection = "Negative Variance with No Revenue" && CurrentClassification = "Negative Variance with No Revenue",1,
CurrentSelection = "No Cost But With Revenue" && CurrentClassification = "No Cost But With Revenue",1,
CurrentSelection = "No Revenue" && CurrentClassification = "No Revenue",1,
CurrentSelection = "No Cost, No Revenue" && CurrentClassification = "No Cost,No Revenue",1,
0
)
hnguy71
2 years agoSuper User
Hi Anonymous ,
One thing to keep in mind is that your string inside your comment measure must match the string inside your flag measure:
Filter Flag =
VAR CurrentClassification = [Comment_drd]
VAR CurrentSelection = SELECTEDVALUE('Filter Comment'[Selection])
RETURN
IF(CurrentSelection = CurrentClassification, 1, 0)
Also, make sure that there's a selection from your dropdown for it to turn from 0 to 1.
I've linked a sample for you so you can get a feel of what to do:
tksnota_filter_measure.pbix