# 30 Day Daily Average Gauge

**URL:** https://discuss.elastic.co/t/30-day-daily-average-gauge/277205
**Category:** Kibana
**Created:** [June 28, 2021, 10:54am UTC](https://discuss.elastic.co/t/30-day-daily-average-gauge/277205 "2021-06-28T10:54:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ryan\_Kapsak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_kapsak/32/81933_2.png) [@Ryan\_Kapsak](https://discuss.elastic.co/u/Ryan_Kapsak)
#### Post date: [June 28, 2021, 10:54am UTC](https://discuss.elastic.co/t/30-day-daily-average-gauge/277205/1 "2021-06-28T10:54:26Z")

</div>

Hi! I am having some trouble setting up a gauge accurately for a visualization in Kibana. I want to display a Daily # of orders that is sold over a 30 day period. My variables are 'order\_qty' and 'date' for the timestamp. I have 'date' set up as a date filter currently, so I normally set the date filter in the top right of Kibana to the last 30 days.

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [June 28, 2021, 11:18am UTC](https://discuss.elastic.co/t/30-day-daily-average-gauge/277205/2 "2021-06-28T11:18:29Z")

</div>

You can do this using aggregation based visualization with "average bucket" like this:

 ![Screenshot 2021-06-28 at 13.17.45](https://us1.discourse-cdn.com/elastic/original/3X/1/5/15b82e721b31e0d223edad73c880355b1f711922.png)

---

<div class="post-metadata">

### Author: ![Ryan\_Kapsak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_kapsak/32/81933_2.png) [@Ryan\_Kapsak](https://discuss.elastic.co/u/Ryan_Kapsak)
#### Post date: [June 29, 2021, 4:28pm UTC](https://discuss.elastic.co/t/30-day-daily-average-gauge/277205/3 "2021-06-29T16:28:29Z")

</div>

Got it. What about this second metric 'bytes' at the bottom you have? Why is it set to a sum?

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [June 29, 2021, 4:33pm UTC](https://discuss.elastic.co/t/30-day-daily-average-gauge/277205/4 "2021-06-29T16:33:00Z")

</div>

This is the metric to calculate the average day for. I just set to to an example - in this case it would give you the average total sum of bytes per day.

Example - consider follow documents:

- Day 1 - 10 bytes
- Day 1 - 5 bytes
- Day 1 - 12 bytes
- Day 2 - 3 bytes
- Day 3 - 7 bytes
- Day 3 - 8 bytes

Daily buckets will look like this:

- Day 1 - 27 bytes (10+5+12)
- Day 2 - 3 bytes (3)
- Day 3 - 15 bytes (7+8)

Average bucket: (27+3+15)/3 - 15 bytes

---

<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: [July 27, 2021, 4:33pm UTC](https://discuss.elastic.co/t/30-day-daily-average-gauge/277205/5 "2021-07-27T16:33:37Z")

</div>

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