# Trouble with the WHERE field in Dashboard Query

**URL:** <https://community.grafana.com/t/trouble-with-the-where-field-in-dashboard-query/92034>\
**Category:** InfluxDB\
**Tags:** influxql, query-help\
**Created:** [July 22, 2023, 8:20am UTC](https://community.grafana.com/t/trouble-with-the-where-field-in-dashboard-query/92034 "2023-07-22T08:20:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick4275](https://avatars.discourse-cdn.com/v4/letter/n/898d66/32.png) [@nick4275](https://community.grafana.com/u/nick4275)\
**Post date:** [July 22, 2023, 8:20am UTC](https://community.grafana.com/t/trouble-with-the-where-field-in-dashboard-query/92034/1 "2023-07-22T08:20:22Z")

</div>

Defo a noob here but with a decent IT background. Any help gratefully received !

Having real trouble with my first Grafana Dashboard. Just can’t get it working at all !

My setup is within Home Assistant so I’m using the InfluxDB and Grafana (v 10.0.2) Add-ons within HA.

Config and setup of both Add-ons seems to have completed successfully and I can see data within Influx and to a lesser extent in Grafana.

My issue occurs when setting up my first Grafana Dashboard Query:  
Using InfluxDB as my data source…  
FROM field set to Autogen  
SELECT MEASUREMENT set to (say) °C  
(All good at this point with data displayed in the main dashboard panel)  
But…  
As soon as I choose anything from the WHERE drop-down I get a “No data” message in the main panel.  
All the tutorials I can find want me to enter “entity\_id” in this field, which I don’t have in my drop-down. The nearest I can see is “entity\_id::tag” which produces the “No data” message. In fact it doesn’t seem to matter what I pick or freehand enter in this WHERE field I always get “No data”

Is this my rank stupidity or an I missing something ?

---

<div class="post-metadata">

**Author:** ![vladvelciu](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/vladvelciu/32/39249_2.png) [@vladvelciu](https://community.grafana.com/u/vladvelciu)\
**Post date:** [October 29, 2023, 8:46am UTC](https://community.grafana.com/t/trouble-with-the-where-field-in-dashboard-query/92034/2 "2023-10-29T08:46:01Z")

</div>

Have you found a solution? I’ve been using grafana and influxdb in Home Assistant for 2 years now and recently I noticed that any dashboard and query I create, it is missing the entity\_id. I only have entity\_id::tag but using this does not filter out entity that do not belong into the respective measurement.

Ex:  
FROM “A” WHERE enitty\_id::tag (this is where it lists every entity)  
in the past I had it like this  
FROM “A” WHERE entity\_id (it listed only the entities that have a measurement in Amps)

This is really strange and I cannot find when and where this has changed and what caused it.

---

<div class="post-metadata">

**Author:** ![t077584](https://avatars.discourse-cdn.com/v4/letter/t/48db29/32.png) [@t077584](https://community.grafana.com/u/t077584)\
**Post date:** [December 17, 2023, 12:51am UTC](https://community.grafana.com/t/trouble-with-the-where-field-in-dashboard-query/92034/3 "2023-12-17T00:51:16Z")

</div>

Same here. I noticed also issues with the new entity-ID::tag. Anybody a solution to this?

---

<div class="post-metadata">

**Author:** ![grant2](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/grant2/32/42281_2.png) [@grant2](https://community.grafana.com/u/grant2)\
**Post date:** [December 17, 2023, 12:15pm UTC](https://community.grafana.com/t/trouble-with-the-where-field-in-dashboard-query/92034/4 "2023-12-17T12:15:50Z")

</div>

Hi @vladvelciu and welcome @t077584 to the Grafana forum.

Not sure this will be helpful, but below is an example of InfluxQL in Grafana with some `WHERE` clauses which do not use template variables, and which specify one tag value from the tag **region** and three tag values from the tag **fueltype**. I cannot say how long it has worked like this or if it was different before, as I have not used InfluxQL over the long term.

```auto
SELECT sum("value")
FROM "ElectricPowerGeneratedByEnergySource"
WHERE ("fueltype"::tag =~ /(Wind|Hydro|Nuclear)/
AND "region"::tag = 'California')
AND $timeFilter
GROUP BY fueltype, time($__interval)

```

![image](https://us1.discourse-cdn.com/grafana/original/3X/a/5/a52ba1cd0f951d51e0d5320a0b846643e35b747b.png)
