Plotting the diff in value change for two series, starting from zero

Hi
We’re running Grafana in the cloud and have run into a small issue when it comes to timeseries in dashboards.

There are two prometheus metrics that are cumulative counters i.e. they started from zero a long time ago. The series can are summed up based on attributes in the metrics so each series contain several series.
We need to plot a timeseries showing how the difference between them has changed since the start of the selected timerange starting from zero.

For example if series contains has the values

(attribute foo=“game1”) = 1000, 1010, 1015, 1030 and
(and attribute foo=“game2”) = 900, 950, 950, 1000

series b has
(attribute foo=“game1”) = 800, 820, 820, 825 and
(attribute foo=“game2”) 700, 720, 730, 750.

The resulting timeseries of input should be which then would be plotted in the timeseries
(attribute foo=“game1”) = 0, -10, -5, 5 and
(attribute foo=“game2”) = 0, 30, 20, 50

Trying to achieve this by doing the queries to get the two originating series not starting from zero.
sum by(foo) (my_metric{attribute1=“series1”})
sum by(foo) (my_metric{attribute1=“series2”})
Then I apply the reduce function on both series getting the minimum value.

Based on these I can calculate the new timeseries by first taking the value for each series and subtracting the minimum value. And the calculating the diff between the two matching series.

The resulting graph doesn’t always start from zero and I’m suspecting that the minimum function doesn’t take into account the multidimensional aspect as it should be the minimum for each series from the prometheus query. So is there an alternative to using expressions to get the minimum for each series or can I somehow reference the first item in the series?