Forum Discussion

Eckhardt_david's avatar
Eckhardt_david
Frequent Visitor
2 years ago
Solved

Get value from previous row

Hi!

 

I'm looking for a way to get a value from a previous row.

So in the example below Row 103 should look in Row 102 and get the value (129) from 'Cumul Backlog'.

I added the index/row because the timestamps are not continuous due to weekends and I thought it would be possible to refer to the current row -1 that way, but I am unable to retrieve the value.

How can I best approach this?

 

Thanks already for the help!

 

 

This would be the desired result:

RowPrevious RowShip Date#Orders to Ship# Orders ShippedCumul BacklogNew Measure
1031028/09/2023665577217129
1021017/09/2023785957129301
1011006/09/202374353530193
100995/09/202369285393254
  • Eckhardt_david , you can try something like this:

    prev_value = 
    CALCULATE (
        MAX ( Table[Cumul_Backlog] ),
        TOPN (
            1,
            FILTER (
                ALLSELECTED ( Table ),
                Table[Row] < MAX ( Table[Row] )
            ),
            Table[Row]
        )
    )

2 Replies

  • ERD's avatar
    ERD
    Icon for Community Champion rankCommunity Champion

    Eckhardt_david , you can try something like this:

    prev_value = 
    CALCULATE (
        MAX ( Table[Cumul_Backlog] ),
        TOPN (
            1,
            FILTER (
                ALLSELECTED ( Table ),
                Table[Row] < MAX ( Table[Row] )
            ),
            Table[Row]
        )
    )