# Two measurements, but graph only arithmetic mean of them

**URL:** <https://community.influxdata.com/t/two-measurements-but-graph-only-arithmetic-mean-of-them/32906>\
**Category:** Dashboards\
**Tags:** influxdb\
**Created:** [January 23, 2024, 9:03am UTC](https://community.influxdata.com/t/two-measurements-but-graph-only-arithmetic-mean-of-them/32906 "2024-01-23T09:03:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomeq82](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/tomeq82/32/14964_2.png) [@tomeq82](https://community.influxdata.com/u/tomeq82)\
**Post date:** [January 23, 2024, 9:03am UTC](https://community.influxdata.com/t/two-measurements-but-graph-only-arithmetic-mean-of-them/32906/1 "2024-01-23T09:03:43Z")

</div>

I was searching for an answer for this rather easy problem but surprisingly I was unable to find solution.  
I have two measurements, from two the same type sensors, they just differ by the id. Both of them have sligtly different readings - but this is ok. I want to graph single arithmetic mean value from both of them - a+b/2 of each reading. Is it possible, if yes - how to do it? 🙂  
I’m scratching head for long, but I think i’m missing something very obvious…

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [January 29, 2024, 7:29pm UTC](https://community.influxdata.com/t/two-measurements-but-graph-only-arithmetic-mean-of-them/32906/2 "2024-01-29T19:29:36Z")

</div>

Hello @tomeq82,  
Welcome!  
What are you hoping to query with? Flux?

```auto
first = from(bucket: "your bucket")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "a" )

second = from(bucket: "your bucket")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "b" )

join(tables: {first: first, second: second}, on: ["_time", "_field"], method: "inner")
|> map(fn: (r) => ({ r with _value: (r.first_value + r.second_value)/2 }))

```

Hope that helps
