Data points outside time range -

To solve this probem:
https://community.grafana.com/t/sum-the-max-value-of-every-day-in-grafana/16522
I used this query. Is there another way to do it?
I used this group by because i need only the max value of the day, then i used group by date.