Forum Discussion

Richard77's avatar
Richard77
Resolver I
3 years ago
Solved

Getting first year based on text column

Hi all, I've been browsing the forum for a while now but haven't found a solution (nor have I been capable of adapating solutions offered on other topics so that it helps me out), so I hope you can h...
  • vanessafvg's avatar
    vanessafvg
    3 years ago

    the issue is once you have a max member numbers, you also next to get the max year then you can use that to get the max year.

     

    Max Lookup =
    VAR maxValue =
    CALCULATE ( MAX ( data[Members] ), ALLEXCEPT ( data, data[ID] ) )
    VAR maxyear =
    CALCULATE (
    MAX ( data[year] ),
    ALLEXCEPT ( data, data[ID] ),
    FILTER ( data, data[Members] = maxValue )
    )
    RETURN
    IF ( data[Members] = maxValue && data[year] = maxyear, "MAX" )