Forum Discussion
Using a Yes/No Measure As a Slicer/Filter
- 6 years ago
Hi sv98917n ,
1. Create a Slicer table manually and use it as a slicer:
2. Create a measure like this:
Measure = VAR _count = CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[date] ) ) RETURN IF ( NOT ( ISFILTERED ( Slicer[Slicer] ) ), _count, IF ( SELECTEDVALUE ( Slicer[Slicer] ) = "Yes" && _count >= 2, "Yes", IF ( SELECTEDVALUE ( Slicer[Slicer] ) = "No" && _count < 2, "No" ) ) )default statususing a slicer
Attached a sample file in the below, hopes to help you.
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your reply. This works slightly. When I apply this method and I select "Yes", the other values that would be "No" are there and not filtered out. They just appear as blank. Any insight? Thank you.
Hi sv98917n ,
1. Create a Slicer table manually and use it as a slicer:
2. Create a measure like this:
Measure =
VAR _count =
CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[date] ) )
RETURN
IF (
NOT ( ISFILTERED ( Slicer[Slicer] ) ),
_count,
IF (
SELECTEDVALUE ( Slicer[Slicer] ) = "Yes"
&& _count >= 2,
"Yes",
IF ( SELECTEDVALUE ( Slicer[Slicer] ) = "No" && _count < 2, "No" )
)
)
default statususing a slicer
Attached a sample file in the below, hopes to help you.
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.