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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mina97
Helper III
Helper III

identify the cases that has the same id but different name

hey i want to identify the cases that has the same id but different name 

T if the Id has multible names F if id has only unique name 

thank you 

 

i have the following data 

idname
216000300jack
216000300noah
217000301jousef
2 ACCEPTED SOLUTIONS
Dangar332
Super User
Super User

hi, @mina97 


try below code 

 

result =
var a =CALCULATE(DISTINCTCOUNT('Table'[name]),ALL('Table'[name]))
return
IF(a>1,"F","T")

adjust your table name
 
Dangar332_0-1697375336481.png

 


If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly. Appreciate your kudos

View solution in original post

Sahir_Maharaj
Super User
Super User

Hello @mina97,

 

Can you please try this:

 

1. Calculate the Number of Unique Names per ID

 

UniqueNameCount = 
COUNTROWS(
    SUMMARIZE(
        FILTER(
            ALL(Table),
            Table[id] = EARLIER(Table[id])
        ),
        Table[name]
    )
)

 

2. Create a New Column to Indicate if an ID has Multiple Names

 

MultipleNamesFlag = 
IF([UniqueNameCount] > 1, TRUE(), FALSE())

 

Once you've created these measures/columns, you can add the MultipleNamesFlag column to your table visual or use it as a filter. The resulting output would be:

id         name    MultipleNamesFlag
216000300  jack    T
216000300  noah    T
217000301  jousef  F

 

Should you require my further assistance, please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

3 REPLIES 3
v-binbinyu-msft
Community Support
Community Support

Hi @mina97 ,

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please feel free to let me know.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sahir_Maharaj
Super User
Super User

Hello @mina97,

 

Can you please try this:

 

1. Calculate the Number of Unique Names per ID

 

UniqueNameCount = 
COUNTROWS(
    SUMMARIZE(
        FILTER(
            ALL(Table),
            Table[id] = EARLIER(Table[id])
        ),
        Table[name]
    )
)

 

2. Create a New Column to Indicate if an ID has Multiple Names

 

MultipleNamesFlag = 
IF([UniqueNameCount] > 1, TRUE(), FALSE())

 

Once you've created these measures/columns, you can add the MultipleNamesFlag column to your table visual or use it as a filter. The resulting output would be:

id         name    MultipleNamesFlag
216000300  jack    T
216000300  noah    T
217000301  jousef  F

 

Should you require my further assistance, please do not hesitate to reach out to me.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Dangar332
Super User
Super User

hi, @mina97 


try below code 

 

result =
var a =CALCULATE(DISTINCTCOUNT('Table'[name]),ALL('Table'[name]))
return
IF(a>1,"F","T")

adjust your table name
 
Dangar332_0-1697375336481.png

 


If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly. Appreciate your kudos

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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