# Get diference between time range on ever-increasing value

**URL:** <https://community.grafana.com/t/get-diference-between-time-range-on-ever-increasing-value/36507>\
**Category:** InfluxDB\
**Created:** [September 12, 2020, 8:19pm UTC](https://community.grafana.com/t/get-diference-between-time-range-on-ever-increasing-value/36507 "2020-09-12T20:19:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zmiguelalves](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/zmiguelalves/32/12765_2.png) [@zmiguelalves](https://community.grafana.com/u/zmiguelalves)\
**Post date:** [September 12, 2020, 8:19pm UTC](https://community.grafana.com/t/get-diference-between-time-range-on-ever-increasing-value/36507/1 "2020-09-12T20:19:36Z")

</div>

Hi, I’m having difficulty figuring this one…

I have an ever-increasing value (Kwh) stored and I want to know by how much it increased in 7/14/30 days. I currently have 20-ish days of data stored.

![](https://pics.coalition.space/5e3012b3-a555-46ee-a3b8-c9693c59d37a.png)  
this is my current query and it seems to work for 7d, but not for 14 or 30. What aggregator/selector am I suppose to choose for this?

I’m getting the time using the group by in the query, is this okay or should I use the relative time instead?

Thanks for the help.
