Count days in timeseries range

Hello,
I am trying to get the number of days in the time range to multiply and add to a value.
Basically, the graph on the left is my energy in kWh but the one on the right should be it translated to $$, and it is based on energy used plus a day rate tariff. Is it possible to get a select that return the number of days in the time range.
@emiltullstedt @torkel


image|690x366

Does this post help (it’s almost 4 years old, but it may still be relevant).