# Calculate the sum in a bar graph

**URL:** <https://discuss.elastic.co/t/calculate-the-sum-in-a-bar-graph/106505>\
**Category:** Kibana\
**Created:** [November 6, 2017, 10:44am UTC](https://discuss.elastic.co/t/calculate-the-sum-in-a-bar-graph/106505 "2017-11-06T10:44:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mad-max](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mad-max](https://discuss.elastic.co/u/mad-max)\
**Post date:** [November 6, 2017, 10:44am UTC](https://discuss.elastic.co/t/calculate-the-sum-in-a-bar-graph/106505/1 "2017-11-06T10:44:04Z")

</div>

Hi at all,  
I would like to know how it is possible to calculate the sum of two bars) which represent, for example, true and false) by creating a new bar that is their sum having the same aggregator

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

M

---

<div class="post-metadata">

**Author:** ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)\
**Post date:** [November 6, 2017, 11:49pm UTC](https://discuss.elastic.co/t/calculate-the-sum-in-a-bar-graph/106505/2 "2017-11-06T23:49:21Z")

</div>

hi @mad-max,

you can do that by using the "Filters" aggregation. Create three filters, one for each condition.

It could look something like:

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

you could also split the series to give them different colors:

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

Be sure to unstack them then (mode=normal):

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

---

<div class="post-metadata">

**Author:** ![mad-max](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mad-max](https://discuss.elastic.co/u/mad-max)\
**Post date:** [November 8, 2017, 8:22am UTC](https://discuss.elastic.co/t/calculate-the-sum-in-a-bar-graph/106505/3 "2017-11-08T08:22:04Z")

</div>

hello  
is ok; but i don't know the term of the filters in advance.  
There Is an other system? thank you very much for the answer.

---

<div class="post-metadata">

**Author:** ![mad-max](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@mad-max](https://discuss.elastic.co/u/mad-max)\
**Post date:** [November 10, 2017, 11:36am UTC](https://discuss.elastic.co/t/calculate-the-sum-in-a-bar-graph/106505/4 "2017-11-10T11:36:18Z")

</div>

HI,

there is not anyone helping me  
M

---

<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 8, 2017, 11:36am UTC](https://discuss.elastic.co/t/calculate-the-sum-in-a-bar-graph/106505/5 "2017-12-08T11:36:36Z")

</div>

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