# How to filter panels in dashboard using variables

**URL:** <https://community.grafana.com/t/how-to-filter-panels-in-dashboard-using-variables/51362>\
**Category:** Grafana\
**Created:** [August 3, 2021, 9:36pm UTC](https://community.grafana.com/t/how-to-filter-panels-in-dashboard-using-variables/51362 "2021-08-03T21:36:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vjsre](https://avatars.discourse-cdn.com/v4/letter/v/ccd318/32.png) [@vjsre](https://community.grafana.com/u/vjsre)\
**Post date:** [August 3, 2021, 9:36pm UTC](https://community.grafana.com/t/how-to-filter-panels-in-dashboard-using-variables/51362/1 "2021-08-03T21:36:12Z")

</div>

- What Grafana version and what operating system are you using?  
8.0.6

- **What** are you trying to achieve?  
I have multiple panels, want to filter it out based on the value chosen from the variable.

- **How** are you trying to achieve it?  
I created a variable and populated pre-defined values to it. marked this variable to chose one value at a time.

- What happened?  
I am able to apply this filter in the query of each panel, however panels are appearing blank and they are still displayed in the dashboard.

What did you **expect** to happen?  
My expectation is to hide those panels that doesn’t match to the criteria. that means, to display panels that match to the value selected from the variable.

- Can you copy/paste the configuration(s) that you are having problems with?

- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us **exactly** what they were.  
I didn’t receive any error.

- Did you follow any online instructions? If so, what is the URL?

---

<div class="post-metadata">

**Author:** ![anon70503803](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@anon70503803](https://community.grafana.com/u/anon70503803)\
**Post date:** [October 4, 2021, 11:57pm UTC](https://community.grafana.com/t/how-to-filter-panels-in-dashboard-using-variables/51362/2 "2021-10-04T23:57:25Z")

</div>

Hi @vjsre

I think you should examine this example dashboard on our public sandbox:  
[https://play.grafana.org/d/000000056/templated-dynamic-dashboard?orgId=1&var-app=backend&var-server=backend\_01&var-server=backend\_03&var-interval=1h](https://play.grafana.org/d/000000056/templated-dynamic-dashboard?orgId=1&var-app=backend&var-server=backend_01&var-server=backend_03&var-interval=1h)

the number of panels changes based on the number of servers that you choose from the variable dropdown. I would inspect how this dashboard uses template variables and try to replicate the pattern

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/grafana/original/2X/e/ef5308cc58c9e5a13187b5012eb99f406928462f.png) [@system](https://community.grafana.com/u/system)\
**Post date:** [August 3, 2022, 9:36pm UTC](https://community.grafana.com/t/how-to-filter-panels-in-dashboard-using-variables/51362/3 "2022-08-03T21:36:31Z")

</div>

Closed on August 3, 2022, 9:36pm UTC

This topic was automatically closed after 365 days. New replies are no longer allowed.
