Sum from other table when previous row is smaller than the following row

Hello again,

Kindly assist with this: I would like to sum sales when the previous row is smaller than the row below it.

2X_2_240e4035faa3a4f7e9f920f5a6b20dd83bbc743a.png
in the image attached, 3479 is smaller than the immediate row below it 5361 so the expression should calculate the sum.

Sum(SELECT(
Sales[Diesel Liter Sales],
[Timestamp] >= MAX(
SELECT(
Sales[Timestamp],
([Diesel Opening Dipstick] >[Most Recent].[Diesel Opening Dipstick] )))))

my expression is giving me an error of unable to find the column โ€œ[Diesel Opening Dipstick]โ€ of [Most Recent].[Diesel Opening Dipstick].
thanks.

0 7 473
7 REPLIES 7
Top Labels in this Space