Forum Discussion

Thilo's avatar
Thilo
Frequent Visitor
7 years ago
Solved

DAX - Complex problem (Nested Grouping + MInx ?)

Hi there! My first post here and I guess it's a more complicated problem. The following data is given (excluding the win column!): I have serveral dealers that sell the same products (look for...
  • v-xuding-msft's avatar
    7 years ago

    Hi Thilo ,

    The following is my sample you can have a try.

    1. Create a calculated column
    Min = CALCULATE(MIN(Table1[Product Price]),FILTER(Table1,Table1[Product Key] = EARLIER(Table1[Product Key]) && Table1[Product Categorie] = EARLIER(Table1[Product Categorie]) && Table1[Min.Amount] >=10))

    1. Create measures
    Win =
    VAR a = CALCULATE(MIN(Table1[Min]),FILTER(Table1,Table1[Min.Amount] >=10))
    return  IF(MAX(Table1[Product Price]) = a, 1,0)
    
    Total = SUMX(Table1,[Win])
    
    

    Best Regards,

    Xue Ding

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