# Year over Year Calculations

**URL:** <https://discuss.elastic.co/t/year-over-year-calculations/227559>\
**Category:** Kibana\
**Created:** [April 10, 2020, 8:48pm UTC](https://discuss.elastic.co/t/year-over-year-calculations/227559 "2020-04-10T20:48:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmankaruse](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@dmankaruse](https://discuss.elastic.co/u/dmankaruse)\
**Post date:** [April 10, 2020, 8:48pm UTC](https://discuss.elastic.co/t/year-over-year-calculations/227559/1 "2020-04-10T20:48:58Z")

</div>

I am trying to create a report with year over year calculations, I want to show to sum of activity in Jan 2020, and compare that with the sum of Jan 2019, I wish to display this is a numeric value of the difference, and show the percent change, how can I do this?

---

<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:** [April 15, 2020, 8:10am UTC](https://discuss.elastic.co/t/year-over-year-calculations/227559/2 "2020-04-15T08:10:16Z")

</div>

You should be able to do that with TSVB and the "serial difference" aggregation:

 ![Screenshot 2020-04-15 at 10.08.43](https://us1.discourse-cdn.com/elastic/original/3X/e/b/eb21a78a9a75b256cfc7ca97a91c68c47f50e806.png)

The "lag" parameter is the number of buckets to compare the current value to, make sure to set the "Interval" to 1 year in the Panel options. In the options tab of the series (the one seen in the screenshot) you can set the formatting to percentage.

---

<div class="post-metadata">

**Author:** ![dmankaruse](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@dmankaruse](https://discuss.elastic.co/u/dmankaruse)\
**Post date:** [April 15, 2020, 4:25pm UTC](https://discuss.elastic.co/t/year-over-year-calculations/227559/3 "2020-04-15T16:25:00Z")

</div>

Great, thank you! One more question for you... Im not seeing a way to filter the data, it appears its doing the calculation on all the data available in kibana, I created a Data Table with the metrics I need and the filters applied, how can I combine this?

I want to show this Week over Week Calculation based on a specific set of data with the filters applied

Thanks!

---

<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:** [April 15, 2020, 4:29pm UTC](https://discuss.elastic.co/t/year-over-year-calculations/227559/4 "2020-04-15T16:29:26Z")

</div>

With data table you mean the visualization type? Filters work a little different there than in TSVB.

In TSVB in the "Panel options" you can specify the index patterns and a field based filter for the visualization:

 ![Screenshot 2020-04-15 at 18.27.16](https://us1.discourse-cdn.com/elastic/original/3X/2/8/283a055c1719cc919608dda4a771573b5b381273.png)

---

<div class="post-metadata">

**Author:** ![dmankaruse](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@dmankaruse](https://discuss.elastic.co/u/dmankaruse)\
**Post date:** [April 15, 2020, 5:58pm UTC](https://discuss.elastic.co/t/year-over-year-calculations/227559/5 "2020-04-15T17:58:27Z")

</div>

Got it, Thank you!

---

<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:** [May 13, 2020, 5:58pm UTC](https://discuss.elastic.co/t/year-over-year-calculations/227559/6 "2020-05-13T17:58:48Z")

</div>

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