# How can I format a column in Lens so it can operate as a sum of time?

**URL:** <https://discuss.elastic.co/t/how-can-i-format-a-column-in-lens-so-it-can-operate-as-a-sum-of-time/346151>\
**Category:** Kibana\
**Tags:** lens\
**Created:** [October 31, 2023, 4:09pm UTC](https://discuss.elastic.co/t/how-can-i-format-a-column-in-lens-so-it-can-operate-as-a-sum-of-time/346151 "2023-10-31T16:09:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SamuelSMendes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuelsmendes/32/104246_2.png) [@SamuelSMendes](https://discuss.elastic.co/u/SamuelSMendes)\
**Post date:** [October 31, 2023, 4:09pm UTC](https://discuss.elastic.co/t/how-can-i-format-a-column-in-lens-so-it-can-operate-as-a-sum-of-time/346151/1 "2023-10-31T16:09:36Z")

</div>

Basically, I have a column in my index that returns the total of time a device is down like this:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/5/05fe356fec110f9d96f779cfaf580712f05ffbe8.png)

But as I go further in time range it turns into something like this:

![image](https://us1.discourse-cdn.com/elastic/original/3X/a/8/a8e82f86dd1f51909c01af9c23c880f9546e156d.png)

I need to format this into the right amount of X hours or even into something like "hh:mm minutes".

While in Canvas I know there are multiple ways to approach this I cannot find a way to check this out in Dashboard/Lens. Would be great to have some ideas to how to achieve this.

Best regards!

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [November 1, 2023, 8:41am UTC](https://discuss.elastic.co/t/how-can-i-format-a-column-in-lens-so-it-can-operate-as-a-sum-of-time/346151/2 "2023-11-01T08:41:58Z")

</div>

What version of the stack are you running?

Recently Lens introduced the Duration formatter within the visualization in latest versions (\> 8.10) :

![Screenshot 2023-11-01 at 09.39.24](https://us1.discourse-cdn.com/elastic/original/3X/c/6/c64a79f4792c97a9f9232fbcf79a5cb4abda6df8.png)

Before that the `Custom format` was available (\> 8.9):

![Screenshot 2023-11-01 at 09.39.01](https://us1.discourse-cdn.com/elastic/original/3X/5/c/5c60dfbbf42bc25c899f498e5912beb2d5fc7b3e.png)

Prior to that, I would suggest to create a runtime field and set a custom formatter for that, which could be either Custom or Duration format.

---

<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:** [November 29, 2023, 8:42am UTC](https://discuss.elastic.co/t/how-can-i-format-a-column-in-lens-so-it-can-operate-as-a-sum-of-time/346151/3 "2023-11-29T08:42:14Z")

</div>

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