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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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

Click here to schedule a short Teams meeting to discuss your question.

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

Click here to schedule a short Teams meeting to discuss your question.

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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.