InfluxDB2.0 FLUX query result of stateDuration() function is displayed wrong in Grafana

Grafana version: v7.5.7 (91de51771c)

I have a FLUX query that uses InfluxDB’s stateDuration() function. This function essentially keeps track of state changes for the value in a targeted column, and produces a duration column which has the cumulative amount of time for which value has remained in the same state.

When I run the query in InfluxDB’s data explorer, I get the expected results back. However, when I try the same query in Grafana, the resulting duration column has all “0” values.

For reference, please see below two screenshots which shows the expected results vs the failure

Below screenshot shows the expected results in InfluxDB data explorer

Below screenshot shows Grafana’s output for the same column with all "0"s