Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Help with the Dax Expression.

Hello guys,   I have a table and a slicer like the following: I'm looking to write an DAX expression for the following logic :   I need to find the Maximum value of the Diff column corresp...
  • v-frfei-msft's avatar
    v-frfei-msft
    6 years ago

    Hi Anonymous ,

     

    Update the formula as below.

    Measure 2 =
    VAR maxp =
        MAX ( 'Table'[req total pos] )
    VAR kk =
        TOPN (
            maxp,
            FILTER ( 'Table', 'Table'[Elim or keep] <> "Elim" ),
            'Table'[Ass Number], ASC
        )
    VAR c =
        CALCULATE ( MAX ( 'Table'[Ass Number] ), KEEPFILTERS ( kk ) )
    RETURN
        CALCULATE ( MAX ( 'Table'[Diff] ), FILTER ( 'Table', 'Table'[Ass Number] = c ) )