Powermeter Total Consumption for 1 day (Difference)

Hi,

i`m new on Prometheus. I want to calculate the Power Consumption for the Last Day and have as Base the Total Consumption of my Powermeter.

So i have to calculate the difference between Last Value of Total Consumption and the First Value of Present Day, the difference is the Today collected Consumption.

But how to do this in Prometheus ?