Sliding window average for specific day of the week based on data from the last month

This seems like a UI bug. The X-Axis isn’t graphing correctly with a custom, non-time unit. You may consider submitting this as a bug on the InfluxDB UI repo.

I have a somewhat hacky workaround that will let you graph it as is. It uses the hour column to build a new timestamp that you can then use to graph:

import "date"
import "strings"

baseTime = date.truncate(t: v.timeRangeStart, unit: 1d)
timeStart = date.truncate(t: experimental.subDuration(d: 14d, from: now()), unit: 1d)
timeStop = date.truncate(t: experimental.addDuration(d: 1d, to: now()), unit: 1d)

replaceHour = (t, h) => {
    updated = strings.replace(v: string(v: t), t: "00:", u: "${string(v:h)}:", i: 1)
    return time(v: updated)
}
 
utilization = from(bucket:"my-bucket") 
    |> range(start: timeStart, stop: timeStop)
    |> filter(fn: (r) => 
        r._measurement == "utilization" and r._field == "utilization%"
    )
    |> filter(fn: (r) => 
        date.weekDay(t: r._time) == 0
    )
    |> aggregateWindow(every: 15m, fn: mean)
    |> map(fn: (r) => ({ r with hour: date.hour(t: r._time) }))
    |> experimental.group(columns: ["hour"], mode: "extend")
    |> mean()
    |> group()
    |> sort(columns: ["hour"])
    |> map(fn: (r) => ({ r with _time: replaceHour(t: baseTime, h: r.hour) }))