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: