# Metric vis on latest date point

**URL:** https://discuss.elastic.co/t/metric-vis-on-latest-date-point/202037
**Category:** Kibana
**Created:** [October 2, 2019, 7:12pm UTC](https://discuss.elastic.co/t/metric-vis-on-latest-date-point/202037 "2019-10-02T19:12:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![warp](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@warp](https://discuss.elastic.co/u/warp)
#### Post date: [October 2, 2019, 7:12pm UTC](https://discuss.elastic.co/t/metric-vis-on-latest-date-point/202037/1 "2019-10-02T19:12:10Z")

</div>

I'd like to mix in one dashboard historic data (a date histogram) with simple data e.g. a metric vis that should show metrics of the latest date inside the currently selected timepicker range.  
Say my date field is `statCreationDate`, is the following the right approach to achieve it?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/7/67ba7ea750cd7c071113bc23409a22227051cc95.png)

---

<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: [October 4, 2019, 10:45am UTC](https://discuss.elastic.co/t/metric-vis-on-latest-date-point/202037/2 "2019-10-04T10:45:51Z")

</div>

You would have to create to different visualizations and then add them to the same dashboard.  
First would be the metric visualizations for the latest value. This is how: [Display latest value in a „Metric“](https://discuss.elastic.co/t/display-latest-value-in-a-metric/114930)  
And for the second, just set a Date Histogram on the startCreationDate field in a line/area/bar chart.

---

<div class="post-metadata">

### Author: ![warp](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@warp](https://discuss.elastic.co/u/warp)
#### Post date: [October 4, 2019, 12:05pm UTC](https://discuss.elastic.co/t/metric-vis-on-latest-date-point/202037/3 "2019-10-04T12:05:13Z")

</div>

Hmm, the Top Hit Agg allows me to display a single value for e.g. my latest timestamp.  
However I want to display a metric on the latest timestamp: e.g. in my initial screenshot I want to have a Count metric (or as another example a sum metric on some field).  
Your suggestion seems to work only for displaying a single value of some field but not a metric (but maybe I'm missing something?)

---

<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: [October 4, 2019, 12:43pm UTC](https://discuss.elastic.co/t/metric-vis-on-latest-date-point/202037/4 "2019-10-04T12:43:22Z")

</div>

That's what I understood from your initial question. Can you give an explicit example with values and everything? This way I can understand your question better.

---

<div class="post-metadata">

### Author: ![warp](https://avatars.discourse-cdn.com/v4/letter/w/8e7dd6/32.png) [@warp](https://discuss.elastic.co/u/warp)
#### Post date: [October 4, 2019, 12:50pm UTC](https://discuss.elastic.co/t/metric-vis-on-latest-date-point/202037/5 "2019-10-04T12:50:48Z")

</div>

Say I have 1000 documents with `statCreationDate="10:00..."` and another 500 documents with `statCreationDate="11:00..."`. I select the whole day in the timepicker.  
A `Count` metric would show now `1500`.  
However I want to only count the docs from the latest `statCreationDate="11:00..."` which should result in 500 docs.

---

<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: [November 1, 2019, 12:50pm UTC](https://discuss.elastic.co/t/metric-vis-on-latest-date-point/202037/6 "2019-11-01T12:50:50Z")

</div>

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