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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mina97
Helper III
Helper III

unique name values based on phone number

Hey ihave the following data 

First Namelast nameemaildegreepayment ID
jackEden Eden exapmle.combachelor250$2160003021
loraTeigen Teigen example.combachelor3403160003021
jackEdinEden1exapmle.combachelor600$5160003021
jackEden Eden1exapmle.combachelor500$5160003021

 

how can i assign uniqe ID to the most frequent first name

because i have a lot of misspelled names and i want to unifiedthem
i wrote the following dax column but it i do not know how to add the most frequent first name part

name unique = 
VAR same_names =
    CALCULATETABLE (
        SUMMARIZE ( 'Table1 (2)', 'Table1 (2)'[ID], 'Table1 (2)'[First Name] ),
        ALLEXCEPT ( 'Table1 (2)', 'Table1 (2)'[First Name] )
    )
VAR ranking = RANKX ( same_names, 'Table1 (2)'[ID],, ASC, DENSE )
VAR blanks = REPT ( UNICHAR ( 8204 ), ranking - 1 )
VAR res = 'Table1 (2)'[First Name] & blanks
RETURN
    res

 

Please HELP and THANK YOU

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @mina97 
Please try

Most Frequent First Name =
VAR SameFirstNameTable =
    SUMMARIZE (
        CALCULATETABLE ( 'Table1 (2)', ALLEXCEPT ( 'Table1 (2)', 'Table1 (2)'[ID] ) ),
        'Table1 (2)'[First Name],
        "@Count", COUNTROWS ( 'Table1 (2)' )
    )
VAR MostFrequentFirstNameTable =
    TOPN ( 1, SameFirstNameTable, [@Count] )
VAR MostFrequentFirstName =
    MAXX ( MostFrequentFirstNameTable, 'Table1 (2)'[First Name] )
RETURN
    MostFrequentFirstName

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @mina97 
Please try

Most Frequent First Name =
VAR SameFirstNameTable =
    SUMMARIZE (
        CALCULATETABLE ( 'Table1 (2)', ALLEXCEPT ( 'Table1 (2)', 'Table1 (2)'[ID] ) ),
        'Table1 (2)'[First Name],
        "@Count", COUNTROWS ( 'Table1 (2)' )
    )
VAR MostFrequentFirstNameTable =
    TOPN ( 1, SameFirstNameTable, [@Count] )
VAR MostFrequentFirstName =
    MAXX ( MostFrequentFirstNameTable, 'Table1 (2)'[First Name] )
RETURN
    MostFrequentFirstName

Helpful resources

Announcements
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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

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

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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