Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
How do I count how many items are available (not how many items I have selected) in a slicer? I need to store it in a variable or measure, so that I can use the value for future use.
Update:
My slicer is something like Market_Slicer in this file:
https://drive.google.com/file/d/1SWSzCKiwckuAr2woo_LeTi2GecsnWlPF/view?usp=sharing
The total number of items varies, depending on choices of another slicer (Company_Slicer).
Solved! Go to Solution.
I managed to find another workaround recently, it is to use ISFILTERED(). I can avoid all the messy variables by using it.
Thanks for all the replies.
I managed to find another workaround recently, it is to use ISFILTERED(). I can avoid all the messy variables by using it.
Thanks for all the replies.
Ok, try:
Avaailable =
VAR _All = CALCULATE (DISTINCTCOUNT (Fact table [Slicer field]), ALL(Fact table ))
RETURN
_All - DISTINCTCOUNT(Fact Table[Slicer field] )
Proud to be a Super User!
Paul on Linkedin.
Try:
available = IF(ISFILTERED ( Table slicer), COUNTROWS (ALL(Table Slicer)) - COUNTROWS (VALUES(Table Slicer [Column])), COUNTROWS (ALL(Table slicer)))
Proud to be a Super User!
Paul on Linkedin.
User | Count |
---|---|
101 | |
90 | |
79 | |
70 | |
69 |
User | Count |
---|---|
112 | |
96 | |
96 | |
75 | |
72 |