# Min and Max timestamp difference

**URL:** <https://discuss.elastic.co/t/min-and-max-timestamp-difference/334634>\
**Category:** Kibana\
**Created:** [May 30, 2023, 5:36am UTC](https://discuss.elastic.co/t/min-and-max-timestamp-difference/334634 "2023-05-30T05:36:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SUBIN\_B\_MATHEW](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/subin_b_mathew/32/118887_2.png) [@SUBIN\_B\_MATHEW](https://discuss.elastic.co/u/SUBIN_B_MATHEW)\
**Post date:** [May 30, 2023, 5:36am UTC](https://discuss.elastic.co/t/min-and-max-timestamp-difference/334634/1 "2023-05-30T05:36:50Z")

</div>

Aggregated the Min and Max timestamp based on the message id. I wanted to calculate the time difference between min and Max time and show it in a data table on kibana dashboard , could you please help me on this?

---

<div class="post-metadata">

**Author:** ![Marta\_Bondyra](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marta_bondyra/32/102122_2.png) [@Marta\_Bondyra](https://discuss.elastic.co/u/Marta_Bondyra)\
**Post date:** [June 20, 2023, 8:04am UTC](https://discuss.elastic.co/t/min-and-max-timestamp-difference/334634/2 "2023-06-20T08:04:11Z")

</div>

Hello, welcome to the community and apologies for the late answer.  
You could use Lens and formula to achieve it. Here's the example:

 ![Screenshot 2023-06-20 at 10.03.26](https://us1.discourse-cdn.com/elastic/original/3X/b/4/b4351525363eba579dfa2e6b9d8a3ef3be4dc358.png)

 ![Screenshot 2023-06-20 at 10.03.22](https://us1.discourse-cdn.com/elastic/original/3X/1/6/1644859123b0b7c3f6cc56facaa4374a0c03ee10.png)

---

<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:** [July 18, 2023, 8:05am UTC](https://discuss.elastic.co/t/min-and-max-timestamp-difference/334634/3 "2023-07-18T08:05:00Z")

</div>

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