# Last\_value sorting by date value

**URL:** <https://discuss.elastic.co/t/last-value-sorting-by-date-value/376417>\
**Category:** Kibana\
**Created:** [March 26, 2025, 12:08pm UTC](https://discuss.elastic.co/t/last-value-sorting-by-date-value/376417 "2025-03-26T12:08:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimraik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimraik/32/142263_2.png) [@kimraik](https://discuss.elastic.co/u/kimraik)\
**Post date:** [March 26, 2025, 12:08pm UTC](https://discuss.elastic.co/t/last-value-sorting-by-date-value/376417/1 "2025-03-26T12:08:15Z")

</div>

when using "last\_value" to display certain data, there is an option based on which date field the last\_value is sorted but this option is gone when using "last\_value" in a formula. Or at least I did not see any. In case there is maybe you can show where?

In default where the sorting by date is available but not with formulas:

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

---

<div class="post-metadata">

**Author:** ![kimraik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimraik/32/142263_2.png) [@kimraik](https://discuss.elastic.co/u/kimraik)\
**Post date:** [March 26, 2025, 12:10pm UTC](https://discuss.elastic.co/t/last-value-sorting-by-date-value/376417/2 "2025-03-26T12:10:18Z")

</div>

This is how I see in Formula mode

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/e/0ec0fbec3a0d82deacdc2d8624c6565f306fed32.png)  
In Formula description it is stated that view's default date will be used which in my case is not what I want to achieve

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [March 27, 2025, 2:53pm UTC](https://discuss.elastic.co/t/last-value-sorting-by-date-value/376417/3 "2025-03-27T14:53:48Z")

</div>

That's correct.  
I've opened a feature request here you can track about it: [[Lens] Provide a way for Lens formula to declare the sorting field for last\_value · Issue #216193 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/216193)
