Forum Discussion

slyfox's avatar
slyfox
Helper II
4 years ago
Solved

Find like

Dear Colleagues,

 

Please tell me which operator is most suitable for my task. I have a simple table with 12,000 rows of accounts, some of which may be duplicates. How do I identify strings like this?
Considered a duplicate if User Name almost the same like already was

IdUser NameUser Name
83792Samanta Smith SMith
92863 SMith_1
  • Hi slyfox ,

     

    1. In your data, if the values of the [User Name] column with similar user name are empty, then you can just delete the rows with empty values of column [User Name].

     

     

    2. Or you can add a custom column and remove the rows that satisfy the condition: [User Name.1] = [Standard Name].

     

     

    = Text.Select([User Name.1], {"a".."z","A".."Z"})

     

     

    And the complete code is as follows:

     

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WsjA2tzRS0lEKTsxNzCtJVAjOzSzJUAAJ+AIZSrE60UqWRhZmxkARmGC8IVgYKGpiiCxsBBY2BBuWpxCVkZiXDmFDlEOVJuaB9McCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Id = _t, #"User Name" = _t, #"User Name.1" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Id", Int64.Type}, {"User Name", type text}, {"User Name.1", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Standard Name", each Text.Select([User Name.1], {"a".."z","A".."Z"})),
        #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([User Name.1] = [Standard Name]))
    in
        #"Filtered Rows"

     

     

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

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

     

2 Replies

  • slyfox Hey ,
    you can use distnict( ) or Value( ) Dax Function to fulfill your requirement .Using this you will get unique record .

     

     

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


    Best regards,
    Harish Mishra

  • v-kkf-msft's avatar
    v-kkf-msft
    Community Support

    Hi slyfox ,

     

    1. In your data, if the values of the [User Name] column with similar user name are empty, then you can just delete the rows with empty values of column [User Name].

     

     

    2. Or you can add a custom column and remove the rows that satisfy the condition: [User Name.1] = [Standard Name].

     

     

    = Text.Select([User Name.1], {"a".."z","A".."Z"})

     

     

    And the complete code is as follows:

     

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WsjA2tzRS0lEKTsxNzCtJVAjOzSzJUAAJ+AIZSrE60UqWRhZmxkARmGC8IVgYKGpiiCxsBBY2BBuWpxCVkZiXDmFDlEOVJuaB9McCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Id = _t, #"User Name" = _t, #"User Name.1" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Id", Int64.Type}, {"User Name", type text}, {"User Name.1", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Standard Name", each Text.Select([User Name.1], {"a".."z","A".."Z"})),
        #"Filtered Rows" = Table.SelectRows(#"Added Custom", each ([User Name.1] = [Standard Name]))
    in
        #"Filtered Rows"

     

     

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

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