# Calculate percentage

**URL:** https://discuss.elastic.co/t/calculate-percentage/206715
**Category:** Kibana
**Created:** [November 6, 2019, 3:43am UTC](https://discuss.elastic.co/t/calculate-percentage/206715 "2019-11-06T03:43:02Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![SheetalRIL](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@SheetalRIL](https://discuss.elastic.co/u/SheetalRIL)
#### Post date: [November 6, 2019, 3:43am UTC](https://discuss.elastic.co/t/calculate-percentage/206715/1 "2019-11-06T03:43:02Z")

</div>

Hi ,

I want to calculate the percentage of some data on Kibana Dashboard.

---

<div class="post-metadata">

### Author: ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)
#### Post date: [November 6, 2019, 3:45am UTC](https://discuss.elastic.co/t/calculate-percentage/206715/2 "2019-11-06T03:45:54Z")

</div>

hello @SheetalRIL

Which version of the elastic stack are you using?

Have you tried using field formatters? [https://www.elastic.co/guide/en/kibana/current/field-formatters-numeric.html](https://www.elastic.co/guide/en/kibana/current/field-formatters-numeric.html)

---

<div class="post-metadata">

### Author: ![SheetalRIL](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@SheetalRIL](https://discuss.elastic.co/u/SheetalRIL)
#### Post date: [November 6, 2019, 3:49am UTC](https://discuss.elastic.co/t/calculate-percentage/206715/3 "2019-11-06T03:49:28Z")

</div>

ELK 6.8.4

---

<div class="post-metadata">

### Author: ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)
#### Post date: [November 6, 2019, 2:37pm UTC](https://discuss.elastic.co/t/calculate-percentage/206715/4 "2019-11-06T14:37:06Z")

</div>

Have you tried using field formatters? [https://www.elastic.co/guide/en/kibana/current/field-formatters-numeric.html](https://www.elastic.co/guide/en/kibana/current/field-formatters-numeric.html)

---

<div class="post-metadata">

### Author: ![SheetalRIL](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@SheetalRIL](https://discuss.elastic.co/u/SheetalRIL)
#### Post date: [November 7, 2019, 5:16am UTC](https://discuss.elastic.co/t/calculate-percentage/206715/5 "2019-11-07T05:16:21Z")

</div>

Hello ,

I have tried it but no luck.

---

<div class="post-metadata">

### Author: ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)
#### Post date: [November 7, 2019, 11:10pm UTC](https://discuss.elastic.co/t/calculate-percentage/206715/6 "2019-11-07T23:10:12Z")

</div>

Can you share some sample documents and describe the desired output?

---

<div class="post-metadata">

### Author: ![SheetalRIL](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@SheetalRIL](https://discuss.elastic.co/u/SheetalRIL)
#### Post date: [November 13, 2019, 9:29am UTC](https://discuss.elastic.co/t/calculate-percentage/206715/7 "2019-11-13T09:29:39Z")

</div>

## 

How to add range to a percentage visualization

[6.8] How to add range to a percentage visualization

This screenshot shows the error percentages of Applications 1-6 respectively. The error percentage is calculated in this visualization by using an average function per application of all the errors. this is done by associating every error query with 1 and every non error query with 0.

After this we want to use a range function on these percentages to divide them into different groups say one less than 0.5 one greater than 0.5.

 ![Screenshot (19).png](https://us1.discourse-cdn.com/elastic/original/3X/6/e/6eb53516297212a062dd535a0f566689180424e1.png)

So how can I bucket these 5 application on Error Percentage. e.g. Category 1 : with error percentage \<0.3 and Category 2 : with error percentage \>0.3

---

<div class="post-metadata">

### Author: ![NerdSec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nerdsec/32/22056_2.png) [@NerdSec](https://discuss.elastic.co/u/NerdSec)
#### Post date: [November 13, 2019, 11:37am UTC](https://discuss.elastic.co/t/calculate-percentage/206715/8 "2019-11-13T11:37:51Z")

</div>

Do you wish to color code the graph based on the output? Seems to be an open issue here:

> <https://github.com/elastic/kibana/issues/4482>
>
> i want to make a bar graph but i want to change the color of bar if it exceed some limit...

If you scroll to the end of this issue there is a comment that highlights a workaround in timelion, did that work out?

```auto
 .es().bars(stack=false).color(#F44336), .min(.es(), 25).bars(stack=false).color(#8BC34A) 

```

> **[Timelion Tutorial – From Zero to Hero](https://www.timroes.de/timelion-tutorial-from-zero-to-hero)**
>
> A tutorial for timelion - the time series composer in Kibana - explaining
> everything you need to start working with timelion.

Regards,  
Nachiket

---

<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: [December 11, 2019, 11:37am UTC](https://discuss.elastic.co/t/calculate-percentage/206715/9 "2019-12-11T11:37:55Z")

</div>

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