So helpful, thank you!
I have data aggregates already at the 1 day level and the following worked fine for me (createEmpty: true to create buckets for time periods that don’t have data). Your solution is good to have seen and thought about but I think my use case is probably more normal so for the copy paste folks out there…
Be sure your connection is setup to use Flux and not InfluxQL in grafana
from(bucket: "mybucket")
|> range(start: -3y, stop: now())
|> filter(fn: (r) => r["_measurement"] == "mymeasurement")
|> filter(fn: (r) => r["_field"] == "myfield")
|> aggregateWindow(every: 1mo, fn: sum, createEmpty: true)
type or paste code here
But if anyone else is a beginner, I also wanted to reference how to change the time units to a custom format as you have done – that was not obvious to me at all. Check this forum link https://community.grafana.com/t/how-to-filter-day-moth-year-in-axis/78286/4