Forum Discussion
Anonymous
6 years agoNot applicable
Count selected values in a slicer
Hi all ,
I'm using
TestSlicerCount =
COUNTROWS(VALUES(FinalTable[Month])) , to count the number of selected values in a slicer with 12 values, works fine but when there are no selections it shows 12 instead of 0. How can i avoid this?
- Anonymous6 years ago
I managed to make it work , thank you amitchandak .
I used this ,
TestSlicerCount = IF(ISFILTERED(FinalTable[Month]), COUNTROWS(VALUES(FinalTable[Month])),0)
6 Replies
- amitchandakSuper User
Anonymous . try like
countx(allselected(table),table[column])
Or
measure =
Var _1 = countx(allselected(table),table[column])
var _2 = countx(all(table),table[column])
return
if(_1=_2 =0,_1)- AnonymousNot applicable
That didn't work , it shows the value as 448 now , i had edited the message just before you replied , maybe you can get a better understanding now
- amitchandakSuper User
Anonymous , try
measure =
Var _1 = calculate(distinctCOUNT(table[column]),allselected(table))
var _2 = calculate(distinctCOUNT(table[column]),all(table))return
if(_1=_2 =0,_1)