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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
sv98917n
Helper I
Helper I

Flag Duplicates as Yes/No, But Not Including Blanks

Hello Everyone, 

 

I am trying to flag duplicate values with the following measure since I need it do work with my page filters: 

 

Critical Segment ID (Y/N) = IF (COUNTROWS ( FILTER ( allselected(Table1), Table1[SEGMENT_ID] = MAX( Table1[SEGMENT_ID] ) ) ) >=2, "YES", "NO" )
 
My only problem is that it is flagging my blank segment IDs as a duplicate and returning "Yes."
 
Anyway for it to ignore the blanks?
 
Thank you! 
1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @sv98917n ,

 

Filter blank value before count rows, check the formula below.

Column =
VAR countid =
    CALCULATE (
        COUNTROWS ( FILTER ( 'Table', 'Table'[value] <> BLANK () ) ),
        ALLEXCEPT ( 'Table', 'Table'[id] )
    )
RETURN
    IF ( countid > 1, "yes", "no" )

1.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @sv98917n ,

 

Filter blank value before count rows, check the formula below.

Column =
VAR countid =
    CALCULATE (
        COUNTROWS ( FILTER ( 'Table', 'Table'[value] <> BLANK () ) ),
        ALLEXCEPT ( 'Table', 'Table'[id] )
    )
RETURN
    IF ( countid > 1, "yes", "no" )

1.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@sv98917n , Try like

 

Critical Segment ID (Y/N) = IF (COUNTROWS ( FILTER ( allselected(Table1), Table1[SEGMENT_ID] = MAX( Table1[SEGMENT_ID] ) ) ) >=2 && not(isblank(Table1[SEGMENT_ID])), "YES", "NO" )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

It won't let me use the column [SEGMENT_ID] after the not(isblank at the end. Says that has to be a measure in order to work. 

darentengmfs
Post Prodigy
Post Prodigy

Hi @sv98917n 

 

Try adding ISBLANK() in your formula

 

IF(ISBLANK(Table1[SEGMENT_ID]), "No"),IF (COUNTROWS ( FILTER ( allselected(Table1), Table1[SEGMENT_ID] = MAX( Table1[SEGMENT_ID] ) ) ) >=2, "YES", "NO" ))

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.