Two different time intervals in one panel?

Hello,

I am using Grafana 9.1 and I have following target:

In an InfluxDB time series, I have the electrical power consumption per hour.

I would like to compare the consumption per hour of the last 24 four hours with the previous 24 hours in one single panel, as bar graphs.

How can I achieve that? Relative time and time shift can only be chosen once per panel.

With the equry editor, I did not get a result. With a query experession, using InfluxQL, I got at least the two bar graphs show, but still an after another, not overlapping:

In Excel it looks like this, and this is what I would like to achive with Grafana:

Thank you very much in advance and best regards,
Falk

Have you explored using Grafana’s dashboard time range settings to compare two different time periods within the same panel? How are you managing the time range in your queries?

For the dashboard, I can only set one time range.

And I can set an individual time range for each panel.

But I would like to set an individual time range for each time series within one panel.

The screenshots show how I manage the time range in the queries: with InfluxQL and the WHERE time … expression.

Did you manage to solve it? I’m experiencing the same situation on my panel. Thank you.

This is a nice solution using Flux.