Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Get most recent non-null value?

I have a table like this. Notice the blank values towards the bottom.     I would like to get the value of the latest date, but the value can't be null. My DAX formula is bringing back the ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    1.If one date has one value, you could simply use LASTNOTBLANK():

    Measure = LASTNONBLANK('Table'[Value],MAX('Table'[Date]))

     

    2. If you want to get the sum of the last date, please try to get the last and value<> blank date firstly and then sum:

    Measure 2 = CALCULATE(SUM('Table'[Value]),FILTER('Table',[Date]=MAXX(FILTER('Table',[Value]<>BLANK()),[Date])))

     

    Output:

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.