# PromQL expression to compute difference in a counter but just 1 value for the full Range Time

**URL:** <https://discuss.prometheus.io/t/promql-expression-to-compute-difference-in-a-counter-but-just-1-value-for-the-full-range-time/3332>\
**Category:** PromQL\
**Created:** [March 13, 2025, 4:25pm UTC](https://discuss.prometheus.io/t/promql-expression-to-compute-difference-in-a-counter-but-just-1-value-for-the-full-range-time/3332 "2025-03-13T16:25:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toni-moreno](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/toni-moreno/32/1138_2.png) [@toni-moreno](https://discuss.prometheus.io/u/toni-moreno)\
**Post date:** [March 13, 2025, 4:25pm UTC](https://discuss.prometheus.io/t/promql-expression-to-compute-difference-in-a-counter-but-just-1-value-for-the-full-range-time/3332/1 "2025-03-13T16:25:24Z")

</div>

Hello everybody.

I would like to do a simple query to get just 1 number for each serie, the original metric is a counter, the result should be the last value minus the first value when the last value is greater than the fist (like the incresase funcion does ) . But I need only 1 value por serie.

my\_metric[end\_time] - my\_metric[start\_time] if (end\_value \> start-time)

Which PromQL expression can give this value per serie?

how can I do it with grafana ?
