# Group by and Sum

**URL:** <https://discuss.elastic.co/t/group-by-and-sum/187299>\
**Category:** Kibana\
**Created:** [June 25, 2019, 10:07am UTC](https://discuss.elastic.co/t/group-by-and-sum/187299 "2019-06-25T10:07:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [June 26, 2019, 12:28am UTC](https://discuss.elastic.co/t/group-by-and-sum/187299/2 "2019-06-26T00:28:26Z")

</div>

I think you should be able to do this with either Visual Builder or Timelion.

Here's an answer to a similar question.

> [@Calculate average in Kibana visualizations](https://discuss.elastic.co/t/calculate-average-in-kibana-visualizations/152668/2):
>
> Hi, what you are looking for is the bucket script aggregation, which allows you to calculate the outcome of several metric aggregations. This is not yet completely implemented in Kibana, see also [https://github.com/elastic/kibana/issues/4707](https://github.com/elastic/kibana/issues/4707) Nevertheless you could actually achieve that (using Bucket Script aka Calculation) in Visual Builder, where you would just create two sum aggregations (for times and time\_sum) and then create a script, that will divide those two and draw this one. The sam…

---

_[View the full topic](https://discuss.elastic.co/t/group-by-and-sum/187299)._
