Power consumption in thousand kilowatthours (divide by 1000)


I have installed Grafana v9.2.2 on a Raspberry Pi 3.
Since I finally got Grafana up and running, I’m trying out dashboards and panels, with the goal of eventually creating reasonable and clear dashboards.
Unfortunately, I can’t get a few things to work the way I want them to, and I haven’t found any useful answers on google and youtube yet. But I found some similar cases with the same questions. In the end also there were no answers or not matching circumstances, which does not help in my case.
I hope that anybody can do me a favour and help me.

I would like to have my yearly power consumption shown in my personal familar units. This means in “thousand kilowatthours”
The result should look like this:

Looks simple, but I can’t get it done yet.
Basically I think it is possible, but I don’t know how.

What I tried is the following:
The data is stored in kWh in the database.
My first idea was logical: Choosing the right unit “kWh”:

But it turned out, that the result is shown in GWh.
Okay, Grafana is some kind of intelligent and has smart units.
I compared the value and found out that it is too high by the factor of 1000.

(sorry, I’m a new user in this forum and only allowed to put in 2 embedded media. I try the other ones in the next post in this thread, hopyfully it works)

My next try was to choose “Wh”:

But it turned out, that the result is shown in MWh.
Now the value is correct, but I’m not satisfied with the unit. It should show “2648 kWh” and not “2.65 MWh”
Looks like Grafana is too intelligent to show a simple value in thousand kilowatthours.

Okay, lets get rid of the intellicence and try it with dumb units.
My next try was to choose a “custom unit: Wh”

With this approach the value is correct, but to high by the factor of 1000
This seems to be easy to solve. I only need to divide the value by the factor of 1000 and then I’m done.

My data source is a JSON, so I quess I cannot do any calculation in the Payload section?!
Grafana 5 Data source

So I tried to use a Transform operation, but I don’t know which.
I tried “Add field from calculation” and changed the mode to “binary operation”.
There it is possible to divide a value by 1000 and it results in the correct value I wanted. Nice!
Grafana 6 Transform

…but it ended up in a strange table and I can’t use it for a bar graph:

I tried everything I can imagine, but I do not know how to get ahead.

So back to my basic simple goal which is to show my power consumption in thousand kilowatthours (e.g. “2648 kWh”)
Can anybody do me a favour and help me to solve this?

Thanks a lot and best regards,

Sorry, I messed up with the sub category. I used “Bar Chart (BETA)” Could any admin please move this Thread to the “Bar Chart (BETA)” sub category? Thanks a lot and sorry for the circumstance. After moving, this post can be deleted. Thank you.

1 Like