Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Create range based on previous row

I have this database with columns A and B and I would like to create columns C and D (START, END), in DAX or Power Query.   Column D would just repeat column B, but column C should be ordered...
  • tamerj1's avatar
    3 years ago

    Hi Anonymous 
    If you wish to use DAX you may try

    Start =
    MAXX (
        FILTER (
            CALCULATETABLE (
                VALUES ( 'Table'[VALUE] ),
                ALLEXCEPT ( 'Table', 'Table'[ITEM] )
            ),
            'Table'[Value] < EARLIER ( 'Table'[Value] )
        ),
        'Table'[Value]
    )