Compare measures: current value vs last N minutes

Hello,

I have timeseries snapshots like:

SnapId, Time, Symbol, PnL

1, 10/1/2025 08:00:00, MSFT, -20

1, 10/1/2025 08:00:00, IBM, 50

2, 10/1/2025 08:15:00, IBM, 25

2, 10/1/2025 08:15:00, MSFT, 200

3, 10/1/2025 08:30:00, IBM, 100

3, 10/1/2025 08:30:00, MSFT, -100

I want to calculate chart with delta PnL differences between different snapshots at symbol level between 2 snapshots which are 30 mins apart. So, here the delta PnL between snapshot 3 and 1 (since they are 30 mins apart) would be: IBM: 75, MSFT: 50, AAPL: -80 . So now, you can imagine I can have a table with Symbol, Delta PnL

Symbol, Delta PnL

IBM, 75

MSFT, 50

AAPL, -80

The time comparison has to be between time when user opens the dashboard and minus 30 mins.

How can I achieve this?

Thank you.

hi - please clarify which PnL values you are trying to compare. are you looking to compare the two values only from snapshot 1 and 3 and ignore 2? i’m asking because the math in the example is not adding up for me. where is 75 coming from for IBM for example.

also, will the data always be in :15 minute intervals?

you should be able to do this using calculated fields but understanding more about the use case would be helpful.

Yes, apologies. the comparison should be between 1 and 3. The use case is whenever the dashboard is opened, it calculates the PnL difference between that time (now() - 30 mins).

I am putting this as the calculated field:

periodOverPeriodDifference(sum({PnL}), now(), MINUTE, 30) but this is not working:

Can you please asdvise?

Thanks.