Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Previous value calculated column

Hello all,    I hope to get a help on getting a correct previous value of the following table:   I'm using this formula. I've tried some measures but somewhow they worked as measure ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous ,

    Please try:

    Previous Value = 
    VAR _Cur_Date = 'Sheet1'[Date]
    VAR _Pre_Date =
        CALCULATE (
            MAX ( 'Sheet1'[Date] ),
            FILTER ( ALL ( 'Sheet1' ), 'Sheet1'[Date] < _Cur_Date )
        )
    VAR _Pre_Value =
        CALCULATE (
            MAX ( 'Sheet1'[Real h_M] ),
            FILTER ( ALL ( 'Sheet1' ), 'Sheet1'[Date] = _Pre_Date )
        )
    RETURN
        _Pre_Value

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data