Calculate electricity price for a time range using spot prices

Welcome @hjpniemi

Are you using Flux or InfluxQL?

Here is a solution using Flux.