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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
MuppetyMe
Helper I
Helper I

Identify duplicates in a column, then populate a new column based on evaluation of a 3rd column

See sample data below. Trying to create a "helper column" to detect duplicates in the ID column and transfer data from the Name column, but only if the Qualified column has a value of Yes. Ideally, if there is a single Name with a Yes condition for an ID, that Name is brought over; if there are multiple Names, assign a value of "Multiple," and if Qualified is No, leave the field blank.

 

Used something similar to the solution in another post (@edhans), but not sure how, where, or if I can tuck in a filter somewhere to only evaluate rows with the Qualified = Yes condition. 

Solved: Find duplicates in a column and give a value - Microsoft Fabric Community

 

Ultimate purpose is to create a FIRSTNONBLANK statement in a column on another table. 

MuppetyMe_2-1727890079111.png

IDNameQualified
ABC1BobYes
ABC1CandiceNo
ABC1KevinNo
ABC1RahulNo
ABC1ViktorNo
ABC2BenoitNo
ABC2JoeYes
ABC2KylerNo
ABC2SamYes
ABC2ViktorNo
ABC3BenoitNo
ABC3BobYes
ABC3JoeYes
ABC3RogerNo
ABC3SamYes
ABC4BenoitNo
ABC4CandiceNo
ABC4KevinNo
ABC4KylerNo
ABC4ViktorNo
ABC5CandiceNo
ABC5JoeYes
ABC5KylerNo
ABC5TomNo
ABC5ViktorNo
1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @MuppetyMe 

 

Hopefully I've understood your requirement.

 

You can create the following Calculated Column to get the output I believe you are wanting.  If you have any questions or want clarification, please let me know.

 

I've also attached a PBIX file for you to assist.

 

HelperColumn = 

VAR CurrentID = 'Table'[ID]

VAR CurrentName = 'Table'[Name]

VAR QualifiedPeople =

    FILTER (
        ALL ( 'Table' ) ,
        'Table'[ID] = CurrentID && 'Table'[Qualified] = "Yes"
    )

VAR QualifiedCount = COUNTROWS ( QualifiedPeople )

VAR QualifiedPersonName =

    IF ( QualifiedCount = 1 , MAXX ( QualifiedPeople , 'Table'[Name] ) , BLANK() )

VAR IsQualified = 'Table'[Qualified] = "Yes"

RETURN

SWITCH ( 
    TRUE() ,
        QualifiedCount = 1 && IsQualified , QualifiedPersonName ,
        QualifiedCount > 1 && IsQualified , "Multiple" ,
    BLANK()
)

 

The output will be as per below.

 

TheoC_0-1727895126404.png

 

Thanks heaps and hope this helps!

 

 

Theo 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

3 REPLIES 3
TheoC
Super User
Super User

Hi @MuppetyMe 

 

Hopefully I've understood your requirement.

 

You can create the following Calculated Column to get the output I believe you are wanting.  If you have any questions or want clarification, please let me know.

 

I've also attached a PBIX file for you to assist.

 

HelperColumn = 

VAR CurrentID = 'Table'[ID]

VAR CurrentName = 'Table'[Name]

VAR QualifiedPeople =

    FILTER (
        ALL ( 'Table' ) ,
        'Table'[ID] = CurrentID && 'Table'[Qualified] = "Yes"
    )

VAR QualifiedCount = COUNTROWS ( QualifiedPeople )

VAR QualifiedPersonName =

    IF ( QualifiedCount = 1 , MAXX ( QualifiedPeople , 'Table'[Name] ) , BLANK() )

VAR IsQualified = 'Table'[Qualified] = "Yes"

RETURN

SWITCH ( 
    TRUE() ,
        QualifiedCount = 1 && IsQualified , QualifiedPersonName ,
        QualifiedCount > 1 && IsQualified , "Multiple" ,
    BLANK()
)

 

The output will be as per below.

 

TheoC_0-1727895126404.png

 

Thanks heaps and hope this helps!

 

 

Theo 🙂

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

THANK YOU @TheoC!!! This worked great. Sending you a virtual hug 🤗
Cheers!

Haha! @MuppetyMe you're an all-star! Massive virtual hugs back to you, too! TheoC_0-1727896204758.png

 

I'm glad it was what you were after!

 

All the best! 😄

 

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors