Panel in Table Visualization

  • What Grafana version and what operating system are you using?
    Docker version 24.0.5 pulls the latest image of Grafana on Ubuntu 22.04.3 (Linux) VM.

  • How and What are you trying to achieve?
    I have created a dashboard, added table visualization, and run two metrics in QueryA and QueryB which have a few similar labels and values and return data in the form of numbers from 0 to 3. The data source is Prometheus and I am using the transformation “join by field” and mode outer(time) on one label name. I want to display the values returned by the queries in two columns, one for task1 and the other for task2. I have achieved these values as ValueA and ValueB in the columns, now I want to set the color of the entire row or a cell on a condition where the value of “task1 < task2” should be red otherwise green.

  • What happened? and * What did you expect to happen?
    I read in some topics here that coloring a row is not possible in the newer versions of Grafana. But I think there should be some transformation or field override that should work in this case to compare two values of two columns and then set the cell color with this. Value mappings and thresholds can work but I don’t have to give a fixed value instead I have to calculate or compare which value is less and then color it. I tried using alerts but alerts can only be defined for time visualization panels but alerting is not my goal here. Just want to set the color on the basis of the comparison of two values returned by two queries.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No nothing

  • Did you follow any online instructions? If so, what is the URL?
    Tried, but the issue is not matching any topics in the community so far.

So the metrics look like this
task1{name = “A”, platform = “X”,} 1
task2{name = “A”, platform = “X”,} 3
task1 is defined in queryA and task2 in queryB.
so “ValueA”=1 and “ValueB”=3
now in the table, I want to color this row or cell in red where valueA<valueB else green color.

Thanks for your help in advance.