Forum Discussion
Wickin
8 years agoFrequent Visitor
Calculate difference between two rows by using Index column
Hi al, I know this question has been asked before, but I tried them all and wasn't able to compete. Sorry! I've got the below table (4 colums) within Power BI (just created a table in Excel t...
- 8 years ago
try this
Column = VAR Index = 'Table'[Index] VAR Reference = 'Table'[Reference] VAR PrevKilometers = CALCULATE ( FIRSTNONBLANK ( 'Table'[Kilometers], TRUE () ), FILTER ( 'Table', 'Table'[Index] = Index - 1 && 'Table'[Reference] = Reference ) ) RETURN IF ( ISBLANK ( PrevKilometers ), BLANK (), 'Table'[Kilometers] - PrevKilometers )
Anonymous
8 years agoNot applicable
Hi Wickin
The image attached is not visible.
It would be great if you provide the Excel with dummy data.
Regards,
Suguna.