Influxdb (v1.7) query or Grafana to return query only if a variable matches a value

Hi all,

We have variables settable by the user.
We want to have multiple queries and only have certain queries return their values if the $variable = "foo" for example.

Is there a way to do this or is this perhaps a bad question?

Looking at transformations did not seem to answer an easy answer, but perhaps i did not mange to get my head to bend around this paradigm.

Thanks for the tips and best wishes
Eric