# How do I divide two metrics calculated in bar-chart

**URL:** <https://discuss.elastic.co/t/how-do-i-divide-two-metrics-calculated-in-bar-chart/276024>\
**Category:** Kibana\
**Created:** [June 15, 2021, 2:53pm UTC](https://discuss.elastic.co/t/how-do-i-divide-two-metrics-calculated-in-bar-chart/276024 "2021-06-15T14:53:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhruv\_Makwana](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dhruv_makwana/32/77691_2.png) [@Dhruv\_Makwana](https://discuss.elastic.co/u/Dhruv_Makwana)\
**Post date:** [June 15, 2021, 2:53pm UTC](https://discuss.elastic.co/t/how-do-i-divide-two-metrics-calculated-in-bar-chart/276024/1 "2021-06-15T14:53:56Z")

</div>

I want to divide two metrics which were calculated by sum and count at the y-axis in Bar-graphs.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/0/00abfd06cef311d2e791193c2a1f596d402218b9.png)  
I went through some discussion, for the newer version there's supposed to `calculation` field in metrics aggregation. But it's not there in my case. Actually, it's already deployed on the server so I can't update it. I know it's possible in `Timelion` but I want a different field in the x-axis, which is not related to any time series.

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [June 15, 2021, 3:52pm UTC](https://discuss.elastic.co/t/how-do-i-divide-two-metrics-calculated-in-bar-chart/276024/2 "2021-06-15T15:52:34Z")

</div>

The Kibana [aggregation reference](https://www.elastic.co/guide/en/kibana/current/aggregation-reference.html#other-features) lists "math on aggregated data" as a feature that only exists in TSVB, Timelion, and Vega. Since you said that you want a different field on the X axis, you probably need to use Vega.

---

<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 13, 2021, 3:52pm UTC](https://discuss.elastic.co/t/how-do-i-divide-two-metrics-calculated-in-bar-chart/276024/3 "2021-07-13T15:52:43Z")

</div>

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