Showing grid export and import for time period

Hey guys,

I’m pretty new to Grafana and Influx, but have most things working from my Tesla Powerwall using Telegraf to import the json fields from the Powerwall.

One value I’m trying to use is a import and export value to/from the grid, which I’d like to graph showing difference from selected date to selected date. For instance, if I select 1st July was start and 31st July as end for the period I want to graph, I’d like to see a graph of usage for that period which adds up.

The values in the database are not reset each time but grow, for instance
energy_exported 5615021.319842277
energy_imported 9600400.66178672

refresh 10 seconds later and they grow and continue to grow.
energy_exported 5615035.22817561
energy_imported 9600400.66178672

I have tried ‘difference’ but that just shows the difference between the last reported value and now, so I’d then need to do that for the entire 30 day period and somehow add them up in a sum?

Many help would be appreciated.