# Percentage Metric

**URL:** https://discuss.elastic.co/t/percentage-metric/349388
**Category:** Kibana
**Created:** [December 14, 2023, 4:03pm UTC](https://discuss.elastic.co/t/percentage-metric/349388 "2023-12-14T16:03:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sbottura](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@sbottura](https://discuss.elastic.co/u/sbottura)
#### Post date: [December 14, 2023, 4:03pm UTC](https://discuss.elastic.co/t/percentage-metric/349388/1 "2023-12-14T16:03:30Z")

</div>

Hello,  
I need to create a Metric which shows the percentage of the sum of one field to the sum of another field.  
Let's say "a" is the sum of all the money I cashed in so far and "b" is the sum of all the money I am set to cash in. I need to know, in percentage, how much I cashed in so far.

I tried with TSVB table but I can't figure out how to set the aggregations or the formula to obtain the desired result.

Thanks in advance,

S.

---

<div class="post-metadata">

### Author: ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)
#### Post date: [December 27, 2023, 10:26pm UTC](https://discuss.elastic.co/t/percentage-metric/349388/2 "2023-12-27T22:26:17Z")

</div>

![image](https://us1.discourse-cdn.com/elastic/original/3X/d/0/d0cac25525d178bb5c2bf215ad53afcebb6b71de.png)  
This is how you set the aggregations, the formula is going to just be (in the case of the screenshot): `test1/test2`

---

<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: [January 24, 2024, 10:26pm UTC](https://discuss.elastic.co/t/percentage-metric/349388/3 "2024-01-24T22:26:53Z")

</div>

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