Kibana: How to obtain the last value of a date field

Hi! I have an index with many documents per device and day.
One of the fields is a date field called "latest_device_activity_dt". Please note that this is not the field that the index is referred to, is a date field that shows relevant information about the device.

For instance, if I choose 1 week in my time picker and display the last values of my date field, I obtain something like this:

I want to display the last value from the most updated document. However, I cannot use "last value" as a quick function, because it does not allow me to operate on date fields. I can only plot a date histogram, but I don't want that, I just want the most recent date. In the example above, I just want to get the 2025-02-19 date value.

Do you know how I could obtain the most recent value of a date field?

Thank you!

Hi @InesCM

have you defined any other row column by chance?

If you have only one row dimension and a single metric then you should have a simple table like that one:

1 Like

Hi Marco!

Thank you for your prompt reply!

I haven't configured any other metric... the problem is that the Metric menu does not allow me to use the quick function "Last value" on a date field, it tells me that it cannot be used in date fields:

In fact, if I choose the quick function "Last value" and then try to add any field, all the date fields are grayed out, because I cannot use it on date fields:

And if I try to force it in a formula, the error tells me that the type is incorrect:

Might the Kibana version be an issue here? I'm using Kibana 7.17.6.

Kind regards,
Inés

Dates support for Last value has been added since Kibana 8.2.0 .

Thank you, Marco! Understood!