Forum Discussion

qmestu's avatar
qmestu
Icon for Helper IV rankHelper IV
4 years ago
Solved

Min and Max not working

Hi, I have the following table (an example) Year Value Category 2020 5 A 2019 3 A 2018 2 A 2020 8 B 2019 4 B 2020 2 C How can i create a measure that returns the Value for the earliest yea...
  • Syk's avatar
    Syk
    4 years ago

    I just re-read your post and missed that you actually wanted the value! Try this

    Value first year = 
    var firstyear = CALCULATE(MIN('Table'[Year]),ALLEXCEPT('Table','Table'[Category]))
    return CALCULATE(sum('Table'[Value]),'Table'[Year]=firstyear)