Forum Discussion

madisonb's avatar
madisonb
Frequent Visitor
2 years ago
Solved

MAX function with multiple conditions for shape map

Hello,   I am creating a shape map with a color saturation of the highest incentives for each state. I am ranking some incentives as more valuable than others (rank column). I want to create a mea...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi madisonb 

     

    Please try this:
    Here I create a measure for your reference:

    MEASURE =
    VAR _currentState =
        SELECTEDVALUE ( 'Table'[State] )
    VAR _MinRank =
        CALCULATE (
            MIN ( 'Table'[Rank] ),
            FILTER ( ALLSELECTED ( 'Table' ), 'Table'[State] = _currentState )
        )
    RETURN
        CALCULATE (
            MAX ( 'Table'[High] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[State] = _currentState
                    && 'Table'[Rank] = _MinRank
            )
        )
    

     The result is as follow:

     

    Best Regards

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