Forum Discussion

tnarenderr's avatar
tnarenderr
Frequent Visitor
3 years ago

Select max value for dynamic filter

TypeModComboValue 
TreComTre - O G12681.37 
TreComTre - R G14357.00 
TreComTre - R O11546.18 
TreComTre - O B12883.55 
TreComTre - O G14220.92 
TreTurTre - O G15558.29 
TreTurTre - O G16895.65 
TreTranTre - O G18233.02 
     
Filter on Combo    
TypeModComboValueMax Value
TreComTre - O G12681.3718233.02
TreComTre - O G14220.9218233.02
TreTurTre - O G15558.2918233.02
TreTurTre - O G16895.6518233.02
TreTranTre - O G18233.0218233.02
     
Filter on Combo and Mod    
TypeModComboValueMax Value
TreComTre - O G12681.3714220.92
TreComTre - O G14220.9214220.92

5 Replies

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi tnarenderr ,

     

    Try formula like below:

    M_ = 
    CALCULATE (
        MAX ( 'Table'[Value] ),
        ALL ( 'Table' ),
        'Table'[Combo] = SELECTEDVALUE ( 'Table'[Combo] )
    )

    M2 =
    VAR sel_mod =
        SELECTEDVALUE ( 'Table'[Mod] )
    VAR sel_combo =
        SELECTEDVALUE ( 'Table'[Combo] )
    RETURN
        CALCULATE (
            MAX ( 'Table'[Value] ),
            ALL ( 'Table' ),
            'Table'[Mod] = sel_mod
                && 'Table'[Combo] = sel_combo
        )

     

    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


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

  • tnarenderr's avatar
    tnarenderr
    Frequent Visitor

    Hi Henry,

     

    Instead of two measures, can we have one measure only. As two measures wont help my requirment.

     

     

    Regards,

    Narender.

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi tnarenderr ,

     

    Try below:

    slicer1 = CROSSJOIN(row("slicer","tyep"),VALUES('Table'[Combo]))
    
    slicer2 = CROSSJOIN(row("slicer","type"),VALUES('Table'[Mod]))
    
    result =
    CALCULATE (
        MAX ( 'Table'[Value] ),
        ALL ( 'Table'[Value] ),
        ALLSELECTED ( 'Table'[Combo], 'Table'[Mod] )
    )

     

     

     

    Best Regards,
    Henry


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

    • tnarenderr's avatar
      tnarenderr
      Frequent Visitor

      Hi Henry,

       

      it is not giving expected results. thanks for your efforts.

       

       

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi tnarenderr ,

     

    Can you point out exactly what the problem is and give me an idea of what you have tried to do so that I can make further changes?

     

    Looking forward to your reply.


    Best Regards,
    Henry