Date histogram error

Is there some difference from the previous topic?

If you need some last metrics other than last document, you can use top metrics aggregation sorted by time stamp.