Forum Discussion

Cadams's avatar
Cadams
Microsoft Employee
4 years ago
Solved

Lookupvalue - Max value with duplicate max values

Good evening,   I'm wondering whether anyone can help. I'm trying to insert a new column in my table with a dax formula that returns the Primary Product based on the ID and max Value (see screensho...
  • tamerj1's avatar
    4 years ago

    Hi Cadams 
    You can use

    New Column =
    VAR CurrentIDTable =
        CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[ID] ) )
    VAR MaxValue =
        MAXX ( CurrentIDTable, Table1[Value] )
    VAR MaxValueProduct =
        CALCULATE ( MAX ( Table1[Product] ), Table1[Value] = MaxValue )
    RETURN
        MaxValueProduct