Forum Discussion

jrobertosm's avatar
jrobertosm
Frequent Visitor
5 years ago
Solved

Calculate the last value per group

Hi team, I need help to return the value of the last item (Doc), group by Contratc. I created an index column. But I am not able to calculate this last value. The solution can be in DAX or M langu...
  • sayaliredij's avatar
    5 years ago

    You can use following formule

     

    LastAvailableValue =
    var last_date = MAX('Table'[Date_Doc])
    RETURN
    CALCULATE(SUM('Table'[Value_Doc]),'Table'[Date_Doc] = last_date)
     
    Thanks,
    Sayali
     
    If this post helps, then please consider Accept it as the solution to help others find it more quickly.