Forum Discussion

FayeB1901's avatar
FayeB1901
Helper I
4 years ago
Solved

Report Last Non Blank Row

Hi there
I'm trying to create a calculated column that returns the last non blank value by a given date. I've tried several DAX options but can't quite get this working. See data below - in this example I would expect a value of -75.71 for 10/11/21.

Thanks in advance
Faye


  • Hi FayeB1901 

     

    Try this:

    Measure=
    Var _A = max(table[Date])
    If(isblank(max(table[value])),
    calculate(max(table[value]),filter(all(table),table[Date]<_A&&table[value]<>blank())),
    max(table[value])
    )

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/

     

     

  • Hi Vahid 

     

    No unfortunately no good - not sure what is going on here with the calculation!

     

7 Replies

  • Hi FayeB1901 

     

    Try this:

    Measure=
    Var _A = max(table[Date])
    If(isblank(max(table[value])),
    calculate(max(table[value]),filter(all(table),table[Date]<_A&&table[value]<>blank())),
    max(table[value])
    )

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
    Appreciate your Kudos!!
    LinkedIn: 
    www.linkedin.com/in/vahid-dm/

     

     

    • FayeB1901's avatar
      FayeB1901
      Helper I

      Hi Vahid 

       

      No unfortunately no good - not sure what is going on here with the calculation!

       

      • FayeB1901's avatar
        FayeB1901
        Helper I

        Vahid got it - it was filter context - wanted ALLSELECTED not ALL. Thank you!