Forum Discussion

sv98917n's avatar
sv98917n
Helper I
6 years ago
Solved

Using a Yes/No Measure As a Slicer/Filter

Hello Community, 

 

I have a measure that returns Yes/No based on duplicate values that is dependant on a date slicer (which is why its in a measure). Is there a way to make a yes/no drop down page filter based on these values. My research tells me that this is impossible, but is there any work around?

 

My measure is:

 

Duplictate Segment ID (Y/N) = IF (COUNTROWS ( FILTER ( allselected(table1), table1[SEGMENT_ID] = max ( table1[SEGMENT_ID] ) ) ) >= 2, "YES", "NO" )
 
Any help would be greatly appreciated. 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.

4 Replies