Resample fails when variable in use

I am using Windows Grafana 8.3.3. My goal is to create a dynamic dashboard with an Elastic (6.8.9) backend for measuring network and software metrics.

Currently, I have graph built taking the sum of a field, and am resampling to 1m to line up time stamps and create a failure rate metric. That works fine. However, as soon as I place a variable in the query, I get all 0’s in the return. I can run the queries with the variable fine, but when I try and resample, it goes to 0.

Since I can only place 2 images per post…

What it looks like is that the query is rewritten as a literal string, rather than the variable being injected,. With the resample, the query looks like this:

Without the resample, it looks like this:

I have zero experience with this, but maybe change your query text after the AND from