Can I hide the panel based on a variable value on grafana Dashboard?

There’s a Github Issue where many people are after the same thing - see Hide empty / no data panels · Issue #4470 · grafana/grafana · GitHub

There’s no direct fix yet unfortunately, but there is something of a workaround/alternative, which I have described here:

I’d suggest starting from HiddenWhenNoDataBehaviour(), and updating it from a “no data” case to the case you are concerned with. I realise many people won’t want to or feel equipped to develop a React app, and deploy it into their Grafana instance however - sorry if this isn’t for you.