Forum Discussion

SLima's avatar
SLima
Icon for Helper I rankHelper I
4 years ago
Solved

Previous line

Get previous value.      
  • VahidDM's avatar
    4 years ago

    Hi SLima 

     

    Try this code to add a new column:

    Calculada = 
    VAR _A =
        CALCULATE (
            MAX ( 'Table'[Coluna 1] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Coluna 1] < EARLIER ( 'Table'[Coluna 1] ) )
        )
    RETURN
        CALCULATE (
            MAX ( 'Table'[Coluna 2] ),
            FILTER ( ALL ( 'Table' ), 'Table'[Coluna 1] = _A )
        )

     

    output:

     

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

    Appreciate your Kudos!!