# Comparing two counts - gauge or percentage

**URL:** https://discuss.elastic.co/t/comparing-two-counts-gauge-or-percentage/197999
**Category:** Kibana
**Created:** [September 4, 2019, 8:11am UTC](https://discuss.elastic.co/t/comparing-two-counts-gauge-or-percentage/197999 "2019-09-04T08:11:24Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![goochjs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goochjs/32/32587_2.png) [@goochjs](https://discuss.elastic.co/u/goochjs)
#### Post date: [September 4, 2019, 8:11am UTC](https://discuss.elastic.co/t/comparing-two-counts-gauge-or-percentage/197999/1 "2019-09-04T08:11:24Z")

</div>

Hi,

We've got two metrics which we would like to compare. One is a count of total work items due for a day. This builds up as hundreds of thousands of events are received during the morning. Let's call the count of these **totA**.

Over the entire day, we receive a different set of events into the same index, which denote each work item being actioned. Let's call the count of these **totB**.

I want to show a comparison between these on a dashboard. Ideally this would be a gauge, measuring **totB** but with maximum range set as **totA**.

Alternatively, I'll settle for showing a metric, calculated as **totB** / **totA** as a %age.

But I can't work out how to do either!

Suggestions gratefully received, thanks.

J.

---

<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: [September 6, 2019, 10:48am UTC](https://discuss.elastic.co/t/comparing-two-counts-gauge-or-percentage/197999/2 "2019-09-06T10:48:02Z")

</div>

You can try with the TSVB (Visual Builder) visualization using the Math aggregations. I think this would be the only way to achieve it.

---

<div class="post-metadata">

### Author: ![goochjs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/goochjs/32/32587_2.png) [@goochjs](https://discuss.elastic.co/u/goochjs)
#### Post date: [September 6, 2019, 11:51am UTC](https://discuss.elastic.co/t/comparing-two-counts-gauge-or-percentage/197999/3 "2019-09-06T11:51:45Z")

</div>

Thanks. I'm not familiar with that tool but will look into it.

It'd be better though if gauges could have dynamic limits, based on the count of a filter.

---

<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: [September 6, 2019, 11:56am UTC](https://discuss.elastic.co/t/comparing-two-counts-gauge-or-percentage/197999/4 "2019-09-06T11:56:03Z")

</div>

You can try and use the parameters from the Math aggregation but i'm not really sure they work in TSVB for now. If you can't get the dynamic limits to work, an enhancement request for it would be great here: [https://github.com/elastic/kibana](https://github.com/elastic/kibana)

---

<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: [October 4, 2019, 11:56am UTC](https://discuss.elastic.co/t/comparing-two-counts-gauge-or-percentage/197999/5 "2019-10-04T11:56:04Z")

</div>

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