# \[solved\] Flux: Query for last value

**URL:** <https://community.influxdata.com/t/solved-flux-query-for-last-value/57616>\
**Category:** InfluxDB 2\
**Tags:** grafana, query\
**Created:** [July 15, 2025, 3:37pm UTC](https://community.influxdata.com/t/solved-flux-query-for-last-value/57616 "2025-07-15T15:37:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DGR75](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@DGR75](https://community.influxdata.com/u/DGR75)\
**Post date:** [July 15, 2025, 3:37pm UTC](https://community.influxdata.com/t/solved-flux-query-for-last-value/57616/1 "2025-07-15T15:37:15Z")

</div>

Hello,  
I would like to display the current value for the current day in this chart in Grafana:

 ![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/3X/0/f/0fab51c44339f85ce575fb57d82f05b4fdba7d67.png)

The values for the current day are stored in a separate measurement, “Wind-currentDay.” However, I only need the last and current value for display purposes.

The query without the daily value looks like this:

from(bucket: “iobroker\_all”)  
|\> range(start: v.timeRangeStart, stop: v.timeRangeStop)  
|\> filter(fn: (r) =\> r[“\_measurement”] == “Wind-PerDay”)  
|\> filter(fn: (r) =\> r[“\_field”] == “value”)

The query should contain the data from “Wind-ProDay” and additionally the current data from “Wind-currentDay.” The data from “Wind-currentDay” should then be displayed in Grafana as an additional bar.

How do I adjust the query?

---

<div class="post-metadata">

**Author:** ![DGR75](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@DGR75](https://community.influxdata.com/u/DGR75)\
**Post date:** [July 15, 2025, 5:14pm UTC](https://community.influxdata.com/t/solved-flux-query-for-last-value/57616/2 "2025-07-15T17:14:54Z")

</div>

this is how it seems to work:

from(bucket: “iobroker\_all”)  
|\> range(start: v.timeRangeStart, stop: v.timeRangeStop)  
|\> filter(fn: (r) =\> r[“\_measurement”] == “Wind-ProTag”)  
|\> filter(fn: (r) =\> r[“\_field”] == “value”)  
|\> aggregateWindow(every: 1d, fn: last, timeSrc:“\_start”)  
|\> yield(name: “protag”)  
from(bucket: “iobroker\_all”)  
|\> range(start: v.timeRangeStart, stop: v.timeRangeStop)  
|\> filter(fn: (r) =\> r[“\_measurement”] == “Wind-aktuellerStand”)  
|\> filter(fn: (r) =\> r[“\_field”] == “value”)  
|\> aggregateWindow(every: 1d, fn: last, timeSrc:“\_start”)  
|\> yield(name: “akttag”)
