# \[SOLVED\] Average of a sum

**URL:** <https://discuss.elastic.co/t/solved-average-of-a-sum/54434>\
**Category:** Kibana\
**Created:** [June 30, 2016, 3:50pm UTC](https://discuss.elastic.co/t/solved-average-of-a-sum/54434 "2016-06-30T15:50:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Lum](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_lum/32/84472_2.png) [@Alex\_Lum](https://discuss.elastic.co/u/Alex_Lum)\
**Post date:** [June 30, 2016, 3:50pm UTC](https://discuss.elastic.co/t/solved-average-of-a-sum/54434/1 "2016-06-30T15:50:44Z")

</div>

Hello,

In visualization, data table , i have a sum of received mega octet.  
I need to make an average of this sum

Total sessions Total received Mo Total sent Mo

3,233,566 810,058.816 1,070,446.362

can i have a column "average" like this :  
total received Mo divided by time range selected in up right?

thanks.

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [July 13, 2016, 7:16pm UTC](https://discuss.elastic.co/t/solved-average-of-a-sum/54434/2 "2016-07-13T19:16:14Z")

</div>

You should just be able to add an Average Metric on the same field you're using to for the Sum of _Total received Mo_, no? Something like this:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/7/7ab49d0cea525a6c4d3b30d8ab5620b30798781a.png)

Here I have the count of requests, the total sum of bytes, and the average bytes per request. Is that what you're asking for, or am I misunderstanding?

---

<div class="post-metadata">

**Author:** ![Alex\_Lum](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_lum/32/84472_2.png) [@Alex\_Lum](https://discuss.elastic.co/u/Alex_Lum)\
**Post date:** [August 9, 2016, 3:26pm UTC](https://discuss.elastic.co/t/solved-average-of-a-sum/54434/3 "2016-08-09T15:26:31Z")

</div>

thank you very much 🙂

---

<div class="post-metadata">

**Author:** ![Janet](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@Janet](https://discuss.elastic.co/u/Janet)\
**Post date:** [August 19, 2016, 10:05pm UTC](https://discuss.elastic.co/t/solved-average-of-a-sum/54434/4 "2016-08-19T22:05:34Z")

</div>

I'm trying to do a very similar thing, but can't seem to make it work. (PEBKAC, I'm sure) How exactly do I make a column that is a sum divided by time range up right?

For example, I have one column that is a top 10 by bytes transferred. I want to display the mbit/sec for the host beside it. I can pre-do some of the math in logstash via ruby if necessary (bytes to bits, etc) but I can't figure out how to take the value and divide it by whatever time is picked. I don't really want the average - there may be hundreds of thousands of packets, so the average size in bytes isn't what I want. I want to make a bytes/time column, where /time is based on the number of seconds in the time picker.

---

<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 6, 2017, 1:40pm UTC](https://discuss.elastic.co/t/solved-average-of-a-sum/54434/5 "2017-07-06T13:40:47Z")

</div>


