Query work on gf explorer but not in variable dashboard

Hi all,

When I use the following query in grafana explorer I have the “right” result:

from(bucket: "telegraf_metrics")
  |> range(start: -30d)
  |> filter(fn: (r) => r._measurement == "cpu")
  |> group(columns: ["cpu"])
  |> distinct(column: "cpu")
  |> keep(columns: ["cpu"])

Table
cpu
cpu-total
cpu0
cpu1
cpu2
cpu3
cpu4
cpu5

But when I try to setup a variable in my dashboard with the same query, I only have :

cpu-total
image

Any idea what’s going wrong?

Grafana v10.1.4
InfluxDB v2.7.1