Forum Discussion

MatthewUK's avatar
MatthewUK
New Member
2 years ago
Solved

How to calculate a value from one column based on another column's maximum value

I have table as shown below. For each Reference, there may be multiple rows at different dates. I want to be able to create a calculated column that will evaluate, for each Reference, the value of th...
  • grazitti_sapna's avatar
    2 years ago

    Hi MatthewUK ,
    You can achieve this by using:- 
    Result =
    VAR MaxDate = CALCULATE(MAX('YourTable'[Date]), ALLEXCEPT('YourTable', 'YourTable'[Reference]))
    RETURN
    CALCULATE(MAX('YourTable'[Count]), 'YourTable'[Date] = MaxDate)


    Hope this will help you.
    Thank you