# How can I calculate difference of count from last day with TSVB metrics?

**URL:** <https://discuss.elastic.co/t/how-can-i-calculate-difference-of-count-from-last-day-with-tsvb-metrics/234062>\
**Category:** Kibana\
**Created:** [May 24, 2020, 7:15pm UTC](https://discuss.elastic.co/t/how-can-i-calculate-difference-of-count-from-last-day-with-tsvb-metrics/234062 "2020-05-24T19:15:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugo\_Pires](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hugo_pires/32/68069_2.png) [@Hugo\_Pires](https://discuss.elastic.co/u/Hugo_Pires)\
**Post date:** [May 24, 2020, 7:15pm UTC](https://discuss.elastic.co/t/how-can-i-calculate-difference-of-count-from-last-day-with-tsvb-metrics/234062/1 "2020-05-24T19:15:31Z")

</div>

Hello

I as trying to use derivative of count to calculate difference between count from today and yesterday, but the value shown is 0

Could you help me?

Thank you

Hugo

---

<div class="post-metadata">

**Author:** ![myasonik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/myasonik/32/62369_2.png) [@myasonik](https://discuss.elastic.co/u/myasonik)\
**Post date:** [May 26, 2020, 8:40pm UTC](https://discuss.elastic.co/t/how-can-i-calculate-difference-of-count-from-last-day-with-tsvb-metrics/234062/2 "2020-05-26T20:40:50Z")

</div>

Hey @Hugo_Pires!

This blog post might be able to help you figure this out (it has several examples of using derivative): [https://www.elastic.co/blog/visualizing-observability-with-kibana-event-rates-and-rate-of-change-in-tsvb](https://www.elastic.co/blog/visualizing-observability-with-kibana-event-rates-and-rate-of-change-in-tsvb)

If you're still stuck after that, can you share what you have so far?

---

<div class="post-metadata">

**Author:** ![Hugo\_Pires](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hugo_pires/32/68069_2.png) [@Hugo\_Pires](https://discuss.elastic.co/u/Hugo_Pires)\
**Post date:** [June 2, 2020, 6:05pm UTC](https://discuss.elastic.co/t/how-can-i-calculate-difference-of-count-from-last-day-with-tsvb-metrics/234062/3 "2020-06-02T18:05:48Z")

</div>

Hello and thank you

I've tried this tutorial but I guess it was not what I needed.

I was looking for a TSVB metric that shows the percentage of variance between the current time bucket (day or hour) and the previous one. According to the signal of variation it will be red or blue - how to do that I have already figured out. The nice to have would be a "conditional" markdown with up arrow and down arrow according to the signal.

Thank you

---

<div class="post-metadata">

**Author:** ![myasonik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/myasonik/32/62369_2.png) [@myasonik](https://discuss.elastic.co/u/myasonik)\
**Post date:** [June 3, 2020, 7:01pm UTC](https://discuss.elastic.co/t/how-can-i-calculate-difference-of-count-from-last-day-with-tsvb-metrics/234062/4 "2020-06-03T19:01:39Z")

</div>

That doesn't sound like a feature we currently support. Feel free to create a feature request on the [Github repo](https://github.com/elastic/kibana) and we'll make sure the right team sees it. Thanks!

---

<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 1, 2020, 7:01pm UTC](https://discuss.elastic.co/t/how-can-i-calculate-difference-of-count-from-last-day-with-tsvb-metrics/234062/5 "2020-07-01T19:01:44Z")

</div>

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