Forum Discussion
Anonymous
6 years agoNot applicable
Difference between 2 rows please?
Hi everyone! My data is structured in Excel (displayed below). I am having translating the Excel formula in Power Bi however, and I need your help please! In Excel I sort the data by Key and...
AlB
6 years agoCommunity Champion
Hi Anonymous
I think there are a few posts dealing with this. Create a new calculated column:
NewCol =
VAR PreviousDate_ =
CALCULATE (
MAX ( Table1[Date] ),
Table1[Date] < EARLIER ( Table1[Date] ),
ALLEXCEPT ( Table1, Table1[Key] )
)
VAR PreviousValue_ =
CALCULATE (
DISTINCT ( Table1[Value] ),
Table1[Date] < PreviousDate_,
ALLEXCEPT ( Table1, Table1[Key] )
)
RETURN
IF ( NOT ISBLANK ( PreviousValue_ ), Table1[Value] - PreviousValue_ )
Please mark the question solved when we get to the solution and consider kudoing if posts are helpful.
Cheers ![]()