# Doing Math over count of events

**URL:** https://discuss.elastic.co/t/doing-math-over-count-of-events/97278
**Category:** Kibana
**Created:** [August 16, 2017, 2:28pm UTC](https://discuss.elastic.co/t/doing-math-over-count-of-events/97278 "2017-08-16T14:28:23Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)
#### Post date: [August 17, 2017, 1:51pm UTC](https://discuss.elastic.co/t/doing-math-over-count-of-events/97278/2 "2017-08-17T13:51:58Z")

</div>

Here's one option if you're on a recent version of Kibana that has the `Visual Builder` visualization type. I know it's in 5.4.0 and later.

1. go to the `Panel Options` tab and set your index pattern (here I'm using `metricbeat-*`);

![image](https://us1.discourse-cdn.com/elastic/original/3X/a/4/a4bb74b8bfe4ae0e6e0f58526cf769e2d83d9831.png)

1. back on the `Data` tab select `Filter Ratio`

![image](https://us1.discourse-cdn.com/elastic/original/3X/4/9/498c35421f340c7b6b80ce8cc51fc41edaef26d7.png)

1. I picked `metricset.name:process` as my numerator, but yours would be something like `transactionStatus:Success`

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

1. The Gauge tab shows a single value and there some options to format as a percent, change the color based on value, etc.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/e/8e65a264920d520394edbd74ae4e907fca10e73e.png)

1. **But the gauge is showing the value of the last interval. Not the average over your whole timespan.** So you might want to change the interval from the default `auto` to something that puts everything in your timespan into one bucket. **WARNING:** You should turn off the `Auto Apply` when changing the interval or you'll have errors (there's a bug on it).

2. Lastly, there's also a Markdown tab that lets you put the value with other text. And when you save this visualization it seems that it saves whatever panel you're on. So you can add it to a dashboard.

Regards,  
Lee

---

_[View the full topic](https://discuss.elastic.co/t/doing-math-over-count-of-events/97278)._
