Can you change table cell background based on a query?

I have a table panel that is created from a query to a mysql database and looks like this:

The query keys off two variables scenarioName and criteriaName from a table lets call it TEST.

I have a separate table called TEST_CONSIST (see below) that has values for some of the pairs from the table above (a pair is for example (A1,A2)). I want the color of the cells in the table above to turn red if the pair exists in TEST_CONSIST. I cannot seem to find a way to change the color of cells beyond using thresholds, which only seem to key off the value in the table you are querying for.

TLDR: I want to change the color of the cells in the table based on the result of a query from a different mysql table.

Thanks in advance.

you can use “value mapping” in panel option, sometimes you have to use override value mapping or threshold value.
this link can help you Format data using value mapping | Grafana documentation

Can you explain further how value mapping would do this?

I think I would need to field override (returned by query) where the query is for the TEST_CONSIST table and then maybe use threshold or value mapping, but I am unsure how to do the override piece. When I look at overrides the only choice I have under fields returned by query is A, which I am unsure what that corresponds too.

1 Like

I have gotten a little further, but still not able to map one result to another.

I have the following two tables from two different queries A and B.
Table A:


Table B:

I have an override setup for Table B that highlights the 1s that show up. What I want is for the cell formatting in Table B to show up in Table A. Both the queries are within the same panel.