# How to get sum of some last values correctly in KIBANA

**URL:** https://discuss.elastic.co/t/how-to-get-sum-of-some-last-values-correctly-in-kibana/317878
**Category:** Kibana
**Created:** [November 1, 2022, 9:05am UTC](https://discuss.elastic.co/t/how-to-get-sum-of-some-last-values-correctly-in-kibana/317878 "2022-11-01T09:05:32Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Joko\_Eliyanto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joko_eliyanto/32/97944_2.png) [@Joko\_Eliyanto](https://discuss.elastic.co/u/Joko_Eliyanto)
#### Post date: [November 1, 2022, 9:05am UTC](https://discuss.elastic.co/t/how-to-get-sum-of-some-last-values-correctly-in-kibana/317878/1 "2022-11-01T09:05:32Z")

</div>

I am a new user in KIBANA dashboard, I just want to create a card that contain sum of certain days last value(for example 1day, 2day, 3day or so on). I think I can get the result I need by change the last value interval in option menu, but I got the wrong result. Am I have miss understanding of Bucketing Concept in Elasticsearch or is it any something wrong?

 ![NANYA](https://us1.discourse-cdn.com/elastic/original/3X/5/f/5f84c03ff74d36a4df596631eb6888294d936313.jpeg)

---

<div class="post-metadata">

### Author: ![Davis\_McPhee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davis_mcphee/32/112461_2.png) [@Davis\_McPhee](https://discuss.elastic.co/u/Davis_McPhee)
#### Post date: [November 2, 2022, 2:33am UTC](https://discuss.elastic.co/t/how-to-get-sum-of-some-last-values-correctly-in-kibana/317878/2 "2022-11-02T02:33:27Z")

</div>

Hi @Joko_Eliyanto, I can't tell exactly how your visualizations are set up, but if I'm understanding your request correctly, I was able to set up a similar dashboard using a combination of a Legacy Metric visualization with the Sum function, and the 'Reduced time range' advanced option. Here's a quick GIF showing what I came up with:  
 ![sum_panels](https://us1.discourse-cdn.com/elastic/original/3X/b/a/ba7fe254c4565726477ceab7c514c91f994f1ff3.gif)

---

<div class="post-metadata">

### Author: ![Joko\_Eliyanto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joko_eliyanto/32/97944_2.png) [@Joko\_Eliyanto](https://discuss.elastic.co/u/Joko_Eliyanto)
#### Post date: [November 2, 2022, 6:47am UTC](https://discuss.elastic.co/t/how-to-get-sum-of-some-last-values-correctly-in-kibana/317878/3 "2022-11-02T06:47:04Z")

</div>

Thanks Davis for the answer, it match with my need. But why I cant find the 'Reduced time range' advance option in my KIBANA, is it any some setting or certain license?

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

---

<div class="post-metadata">

### Author: ![Davis\_McPhee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davis_mcphee/32/112461_2.png) [@Davis\_McPhee](https://discuss.elastic.co/u/Davis_McPhee)
#### Post date: [November 2, 2022, 4:51pm UTC](https://discuss.elastic.co/t/how-to-get-sum-of-some-last-values-correctly-in-kibana/317878/4 "2022-11-02T16:51:50Z")

</div>

I probably should have asked which version of Kibana you were using first. The option I suggested was only recently released in 8.5: [[Lens] Add reduced time range option by flash1293 · Pull Request #136706 · elastic/kibana · GitHub](https://github.com/elastic/kibana/pull/136706). If you're using an older 8.x release and aren't able to upgrade to 8.5, an alternative that might work for you is the 'Customize time range' option in the Dashboard panel options menu. Here's another quick example:  
 ![sum_panels_new](https://us1.discourse-cdn.com/elastic/original/3X/0/5/05017533b909cb0c569b130cd13430eb436bde6f.gif)

---

<div class="post-metadata">

### Author: ![Joko\_Eliyanto](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joko_eliyanto/32/97944_2.png) [@Joko\_Eliyanto](https://discuss.elastic.co/u/Joko_Eliyanto)
#### Post date: [November 3, 2022, 4:37am UTC](https://discuss.elastic.co/t/how-to-get-sum-of-some-last-values-correctly-in-kibana/317878/5 "2022-11-03T04:37:25Z")

</div>

Thanks Davis, the last answer was solution for my problem, once again

Terima Kasih (Thanks in Bahasa Indonesia)

---

<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 1, 2022, 4:37am UTC](https://discuss.elastic.co/t/how-to-get-sum-of-some-last-values-correctly-in-kibana/317878/6 "2022-12-01T04:37:47Z")

</div>

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