title: Filter Grafana dashboard according to a rule on a single Field
body: <p>Data source is SQL Server, Grafana version 9.1.2.</p>
  <p>I'm building a grafana dashboard for a range of metrics and aggregated data. A mixture of all sorts, lots of custom queries to the SQL Server database already.</p>
  <p>However, if a particular field passes a certain threshold, then all the other data is irrelevant/should be ignored.</p>
  <p>For background, I'm visualizing a manufacturing process, viewing field &quot;w&quot;, &quot;x&quot;, &quot;y&quot; and &quot;z&quot;. The field &quot;w&quot; is a field representing the flow of material into the start of the process, so if &quot;w&quot; = 0 (or &lt; than 10 for argument's sake), then values for x/y/z should be ignored, both in line graphs, and also in aggregations (I don't want my averages in bar graphs to be skewed by the incorrect input data).</p>
  <p>I'm struggling a little to find the right way to search for how others may have done this before, my source data is all &quot;long and thin&quot; (time,value,metric) already, so pivoting out field &quot;w&quot; in every query is going to make query strings <em>ugly</em>, and cost compute on the SQL Server too (but this is possibly as a last resort).</p>
  <p>Any help would be appreciated.</p>