# Energy unit conversion in Graph visualization

**URL:** <https://community.grafana.com/t/energy-unit-conversion-in-graph-visualization/45883>\
**Category:** Time Series Panel\
**Created:** [April 11, 2021, 3:50pm UTC](https://community.grafana.com/t/energy-unit-conversion-in-graph-visualization/45883 "2021-04-11T15:50:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dba2016](https://avatars.discourse-cdn.com/v4/letter/d/aca169/32.png) [@dba2016](https://community.grafana.com/u/dba2016)\
**Post date:** [April 11, 2021, 3:50pm UTC](https://community.grafana.com/t/energy-unit-conversion-in-graph-visualization/45883/1 "2021-04-11T15:50:29Z")

</div>

Hi there,

I am trying to setup an energy-clock graph and I am a bit lost at the following issue: my energy clock counts in Wh (watt-hours), and I think I can convert it to kWh on the query side (should be possible to just divide by 1000, I guess).

However, the numbers are well over 1000 (currently around 2900), so Grafana converts this to mWh. Not that it would be technically wrong (1000 kWh is 1 mWh, after all), but nobody uses mWh in normal one-house energy calculations.

Having read about short+postfix workaround, I tried “stat” visualization, but that one does not offer any postfix nor even unit selection (I am on Grafana v7.5.3).

So in a nutshell, I want to ideally only convert to kWh, or if it is not possible, prevent unit conversion entirely (while still displaying a kWh postfix).

Thanks in advance  
Best regards  
DBa

---

<div class="post-metadata">

**Author:** ![anon70503803](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon70503803](https://community.grafana.com/u/anon70503803)\
**Post date:** [April 14, 2021, 2:37am UTC](https://community.grafana.com/t/energy-unit-conversion-in-graph-visualization/45883/2 "2021-04-14T02:37:04Z")

</div>

Hi @dba2016,

So, if I understand the situation correctly:

If you had data entering Grafana with a value like, say `2974`, then you want it to read `2.974 kWh` on your graph, is that correct? Some screenshots of your graph and how exactly you’d like to transform your data would help a lot here I think!

---

<div class="post-metadata">

**Author:** ![patse](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@patse](https://community.grafana.com/u/patse)\
**Post date:** [April 14, 2021, 8:18am UTC](https://community.grafana.com/t/energy-unit-conversion-in-graph-visualization/45883/3 "2021-04-14T08:18:23Z")

</div>

I had the same problem in the graph panel. I just divided with 1000 to get kWh and made a costum Unit with kWh. I hope the screenshot helps  
 ![image](https://us1.discourse-cdn.com/grafana/original/2X/e/e322338417b74c9c0a83241c6b54ad94a16c48a4.png)
