How to display as percent given these data?

Hi, I’m totally lost on how to display data in x.x% format. Here is what I have

Given these data, total of 3072 and failure of 13. I want to calculate them by ((13 * 100) / 3072) so that it give me 0.42% to be shown in panel.

Using aspercent(A) give me weird value, also the same with doing binary operation in transformation. Nothing works for me.

Please advice.

Welcome

Please provide
1.version of grafana
2. Data source
3. Sample data as inline csv

Timeline,metric,value 
2022-05-13 02:23:33,'heat',23.5

Hello,

  1. Grafana v8.3.0-pre
  2. Data source white falcon
  3. I don’t have any sample data to give. I just don’t know what best to represent my question. As you can see in the screenshot attached, there are two set of data. Query A is total count, and query B is total count with status failure only. Sorry for inconvenience.

Add an expression that references the queries. Not sure what white flacon is (please add reference here to see if it is something we can download) but generally one can do one simple query to get all of this in one take

image

You can also use a calculation, and tick the radio button that says Replace all fields:

That will leave you with only one value displayed.

1 Like

Hi Team
I have tried both its not working

$A *100 / $B this tried in C pannel, its showing N/A
Can anyone have idea on this.please help

Welcome @jyothin212
Maybe try to do a reduce to “last” value expression on A and B before doing the calculation? Also, what is your datasource and query(ies)? It may be easier to do the calculation there.

What are the values for a and b?

@skalover I have just encountered the same problem and found the solution.
For the binary operation to work correctly you must first reduce all fields to Total.
Then you can do a couple of operations to get the %.


Result of all 4 values
image