Forum Discussion

puru85's avatar
puru85
Helper II
2 years ago
Solved

Creating Family Keys Based on Shared Address or Phone Number

Hello Experts, I am working on a DAX formula to create family keys in my customer table by grouping records based on shared addresses or phone numbers.   Current Logic: I am using the ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi puru85 

     

    The link you provided can not be opened:

    Here I create a set of sample:

    Then add a calculated column:

     

    Outcome =
    VAR _VTABLE =
        ADDCOLUMNS (
            ALLSELECTED ( 'Table' ),
            "_MinAddress",
                CALCULATE (
                    MIN ( 'Table'[Id] ),
                    FILTER (
                        ALLSELECTED ( 'Table' ),
                        'Table'[Address] = EARLIER ( 'Table'[Address] )
                    )
                )
        )
    RETURN
        MINX (
            FILTER ( _VTABLE, 'Table'[phone] = EARLIER ( 'Table'[phone] ) ),
            [_MinAddress]
        )
    

     

    The result is as follow:

     

     

    Best Regards

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