# Weighted Average in Kibana

**URL:** <https://discuss.elastic.co/t/weighted-average-in-kibana/175580>\
**Category:** Kibana\
**Created:** [April 5, 2019, 11:43am UTC](https://discuss.elastic.co/t/weighted-average-in-kibana/175580 "2019-04-05T11:43:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier\_de\_la\_Rosa\_Fe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javier_de_la_rosa_fe/32/43558_2.png) [@Javier\_de\_la\_Rosa\_Fe](https://discuss.elastic.co/u/Javier_de_la_Rosa_Fe)\
**Post date:** [April 5, 2019, 11:43am UTC](https://discuss.elastic.co/t/weighted-average-in-kibana/175580/1 "2019-04-05T11:43:34Z")

</div>

Hi,

I know there are some topics talking about this, but I still don't understand.

I want to create a metric in Kibana to contain the following calculation: (sum(a) + sum(b)) / sum(c), where a, b and c are another metrics.

I read some topics and documentation like [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-weight-avg-aggregation.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-weight-avg-aggregation.html)

But I still don't know how to apply this in Kibaba.

Can anyone help me with this issue?

Thanks!

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 5, 2019, 7:42pm UTC](https://discuss.elastic.co/t/weighted-average-in-kibana/175580/2 "2019-04-05T19:42:56Z")

</div>

You can use [Timelion](https://www.elastic.co/guide/en/kibana/6.7/timelion.html) to calculate values based on metric values.

---

<div class="post-metadata">

**Author:** ![Javier\_de\_la\_Rosa\_Fe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javier_de_la_rosa_fe/32/43558_2.png) [@Javier\_de\_la\_Rosa\_Fe](https://discuss.elastic.co/u/Javier_de_la_Rosa_Fe)\
**Post date:** [April 6, 2019, 8:57am UTC](https://discuss.elastic.co/t/weighted-average-in-kibana/175580/3 "2019-04-06T08:57:25Z")

</div>

Thanks for your answer.

The thing is I need to show this visualization in a dashboard with other visualizations. Is it possible to do this with a timelion?

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [April 6, 2019, 4:05pm UTC](https://discuss.elastic.co/t/weighted-average-in-kibana/175580/4 "2019-04-06T16:05:35Z")

</div>

> The thing is I need to show this visualization in a dashboard with other visualizations. Is it possible to do this with a timelion?

Yes. Instead of using the Timelion app, create a timelion visualization in the Visualize app

 ![36%20AM](https://us1.discourse-cdn.com/elastic/original/3X/a/5/a55e8690da706185eb262be3b889142be37a9d08.jpeg)

---

<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:** [May 4, 2019, 4:05pm UTC](https://discuss.elastic.co/t/weighted-average-in-kibana/175580/5 "2019-05-04T16:05:40Z")

</div>

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