Problems with influx query

Hey,
I’m trying to build a panel that displays the daily consumption of my home over a period of the last two weeks.

Currently it looks like this:

I did an override to the first colum to show the date in a specific format.

My problem is that the flux query doesn’t use the proper value at midnight but the value that is present at 2AM (you can clearly see it in the table view). This shifts around my consumption numbers a lot. Are there any suggestions how to modify the query so it takes the value from midnight?

Table view for reference:

Thank you in advance!

Welcome

Influxql or flux query?