Forum Discussion

awitt's avatar
awitt
Helper III
6 years ago
Solved

Distinct Identifier

I have a dataset which i need to add a column that labels whether or not a store location is unique. When a store has multiple products my data is providing the total units for all products in the co...
  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    6 years ago

    awitt 

     

    Infact the formula can be reduced to following. If you need result as Binary, you can chantge the data type to Binary from the Modelling tab>>formatting section. 1 is equivalent to TRUE, 0 is equivalent to FALSE

     

    Column Formula =
    VAR myrank =
        RANKX (
            CALCULATETABLE (
                'TableName',
                ALLEXCEPT ( 'TableName', 'TableName'[Store], 'TableName'[City] )
            ),
            [Product],
            ,
            ASC,
            DENSE
        )
    RETURN
        IF ( myrank = 1, 1, 0 )