Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
sv98917n
Helper I
Helper I

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. 
1 ACCEPTED SOLUTION

Hi @sv98917n ,

1. Create a Slicer table manually and use it as a slicer:

yes no.png

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 statusdefault statususing a slicerusing 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.

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@sv98917n - In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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:

yes no.png

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 statusdefault statususing a slicerusing 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.

amitchandak
Super User
Super User

@sv98917n , You have to create Table with yes and no.

And use along with this measure at a correct row context

 

refer

https://www.daxpatterns.com/dynamic-segmentation/
https://radacad.com/grouping-and-binning-step-towards-better-data-visualization

 

https://www.daxpatterns.com/static-segmentation/
https://www.poweredsolutions.co/2020/01/11/dax-vs-power-query-static-segmentation-in-power-bi-dax-po...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.