Forum Discussion
bvy
4 years agoHelper V
Count selected slicer values -- BUT exclude two explicit entries
Hello I have a slicer with values A, B, C, D and E (for example). I need DAX to return the number of items selected -- BUT exclude A and/or B from the count if they're selected.
So I can use this to get the count of selected values, but not sure where to filter out (ignore) A and B from the count.
_count = IF(ISFILTERED(Slicer[ABCDE]), COUNTROWS(VALUES(Slicer[ABCDE])))
Thanks,
- Thank you. This seemed to work as well.COUNTX(FILTER(ALLSELECTED(Table[Option]), NOT Table[Option] IN {"A", "B"}), Table[Option])
4 Replies
- bvyHelper V
Thank you but nothing about that seems to work. For example, COUNTROWS() takes a table as an argument, not a column. The FILTER seems to ignore selected values.
Everything is in one table currently.
Anyone else?
- danextianSuper User
Hello, Please try this:
Value without A and B = CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( Slicer, Slicer[Column] <> "A" && Slicer[Column] <> "B" ) )