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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
NSBS
Helper I
Helper I

Row Comparison and Detecting Different Corresponding Values

Hi Experts,

 

Kindly help to give idea on how should I compare below row to detect which ID have more than 1 names.

My Original Dataset only consists of Column ID and Name. And I want the result to be reflected as per Expected Result Column.

IDNameExpected Result
123Greg1 ID have more than 1 names
892Nat1 ID per 1 Name
878Tina1 ID per 1 Name
748Aid1 ID have more than 1 names
123Raul1 ID have more than 1 names
748Sam1 ID have more than 1 names
892Nat1 ID per 1 Name

 

Thank you.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture2.png

 

Expected result CC =
VAR _condition =
    COUNTROWS (
        SUMMARIZE ( FILTER ( Data, Data[ID] = EARLIER ( Data[ID] ) ), Data[Name] )
    ) = 1
RETURN
    IF ( _condition, "ID per 1 name", "ID have more than 1 names" )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture2.png

 

Expected result CC =
VAR _condition =
    COUNTROWS (
        SUMMARIZE ( FILTER ( Data, Data[ID] = EARLIER ( Data[ID] ) ), Data[Name] )
    ) = 1
RETURN
    IF ( _condition, "ID per 1 name", "ID have more than 1 names" )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Hi @Jihwan_Kim ,

 

Currently I'm in the need of the M code for this row comparison as well. I have try to create it but no output.

Kindly help on this matter.

 

Thank you.

Hi @Jihwan_Kim ,

 

Thank you for your solution. It is working. Really appreciation your support and time

Hi @Jihwan_Kim ,

 

Can you help to provide M code equivalent to the DAX code that you provided before?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.