# Show dynamic trend values in Dashboard

**URL:** <https://discuss.elastic.co/t/show-dynamic-trend-values-in-dashboard/325182>\
**Category:** Kibana\
**Tags:** lens\
**Created:** [February 9, 2023, 5:28pm UTC](https://discuss.elastic.co/t/show-dynamic-trend-values-in-dashboard/325182 "2023-02-09T17:28:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![beijo](https://avatars.discourse-cdn.com/v4/letter/b/58f4c7/32.png) [@beijo](https://discuss.elastic.co/u/beijo)\
**Post date:** [February 9, 2023, 5:28pm UTC](https://discuss.elastic.co/t/show-dynamic-trend-values-in-dashboard/325182/1 "2023-02-09T17:28:18Z")

</div>

Hi all,

I have documents which include a `count` field (numbers). I want to implement a dashboard, in which based on the selected timerange, the difference of the first document's `count` value and the last documents `count` value is displayed. (Kind of a trend metric, which shows how much the values decreased/increased during the selected time frame).  
I'm currently only able to show static trends with the following formula:` last_value(count)- last_value(count,shift='7d')` However I need the value to be calculated based on the selected time frame and unfortunately there is no function such as `first_value()`  
Are there any solutions to those requirements?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 9, 2023, 5:28pm UTC](https://discuss.elastic.co/t/show-dynamic-trend-values-in-dashboard/325182/2 "2023-03-09T17:28:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
