March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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,
Solved! Go to Solution.
Hi @bvy ,
Assuming there is an existing relationship between the slicer table and table being counted, try something like below:
count =
CALCULATE (
COUNTROWS ( Table[Column] ),
FILTER ( Slicer, NOT VALUES ( Slicer[Value] ) IN { "A", "B" } )
)
Proud to be a Super User!
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?
Hello, Please try this:
Value without A and B =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( Slicer, Slicer[Column] <> "A" && Slicer[Column] <> "B" )
)
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |