Forum Discussion

Smallegrue's avatar
Smallegrue
Frequent Visitor
6 years ago
Solved

Referencing rows within same table based on events

Hello all,   I've been having trouble with this and I can't seem to figure it out.   I have an equipement status table that records a row everytime an equipement status changes or at the end of a...
  • v-lid-msft's avatar
    v-lid-msft
    6 years ago

    Hi Smallegrue ,

     

    We can create a calculated column to meet your requirement:

     

    Original Failure line ID =
    IF (
        [Status] = "Down",
        CALCULATE (
            MIN ( 'Table'[Row ID] ),
            FILTER (
                'Table',
                'Table'[Row ID]
                    > CALCULATE (
                        MAX ( 'Table'[Row ID] ),
                        FILTER (
                            'Table',
                            'Table'[Row ID] <= EARLIER ( 'Table'[Row ID], 2 )
                                && 'Table'[Status] = "Up"
                        )
                    )
                    && 'Table'[Status] = "Down"
            )
        )
    )
    

     

     


    Best regards,