Legend shows filtered Values

Hi,
I have a Grafana Dashboard with different Hosts and a Host Filter.
It works all well, but the Legend shows all Values, the filtered and not-filtered.

I have a Dashboard Variable as a filter.
I Filter the Visualization via Transformations - Filter Data by values
The Grafic is filtered but the Legend shows all Options.
How can i filter the Legend?

Regards
Timo

You can consider the following steps to resolve your issue. I hope this proves helpful

Step :1 Adjust the Query or Variable

Ensure your query only fetches the data for the selected filter (use WHERE or label_filter to limit the results by host).

Step 2: Use the Transformation to Filter Data

Go to the panel settings and add a Transformation.
Use the Filter data by values transformation to filter the data based on your selected variable (e.g., host).

Step 3: Adjust the Legend Display

In the panel, go to the Legend settings.
Enable Show only current series to display only the filtered series in the legend.

Step 4: Verify the Filtered Data

Ensure your legend now only shows the filtered series, and it should match the filtered graph.

This should fix the issue!

Hi, thanks for your Replay.
I use the Timeseries Visualiation and I don’t have the Option “Show only current series”.
I have only:
Visibility (on & off), Mode (List, Table), Placement and Values.

Thank you for prefer my solution
you can try suggestions section beside of visualization
or
if it’s not work then we work on it together

Sorry for posting after so long time.

My query is this:

from(bucket: “system”)

|> range(start: v.timeRangeStart, stop: v.timeRangeStop)

|> filter(fn: (r) => r[“_measurement”] == “cpu” or r[“_measurement”] == “system_cpu”)

|> filter(fn: (r) => r[“_field”] == “usage_iowait” or r[“_field”] == “usage_user”)

|> filter(fn: (r) => r[“cpu”] == “cpu-total”)

|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)

|> yield(name: “mean”)

and this query is filtered with Transformation after my Variable with one Host.

The Legend shows all iowait & user from every Host.

See in the Uploaded pictures. I have no Option “Show only current series to display“.