Conditional Cell Coloring for Percentages in Grafana Table Using SQL Server

Hello,

I am working on a Grafana table visualization connected to SQL Server, and I need to apply color formatting to individual cells that contain percentage values. Specifically, I want to:

  • Color cells red if the percentage is less than 0
  • Color cells green if the percentage is greater than 0

Additionally, I would like to change the text color (font color) within these cells based on the value.

Could anyone provide guidance on how to achieve this in Grafana using SQL Server queries or Grafana’s settings?

Thank you for your help

you can use thresholds and cell backgrounds for those, check out the grafana play site for some of the table panel features:

https://play.grafana.org/d/U_bZIMRMk/table-panel-showcase?orgId=1&from=now-6h&to=now&timezone=utc

Thank you for the suggestion! However, I would like to mention that the columns for the dates in my table are dynamic, meaning the column titles are not static. This adds a layer of complexity to applying conditional formatting, as the columns can change depending on the data displayed.

Do you have any suggestions on how to handle this dynamic nature of the table while still implementing the cell color formatting?

if you switch your column types to numbers, you can apply the field overrides by field type instead of name.