Show ok rate by path use graph with data source is es

What Grafana version and what operating system are you using?

Grafana v7.2.2 (ad9d408ac2), macOS 13.2

What are you trying to achieve?

make ok rate by path use graph with data source is es

How are you trying to achieve it?

I can create one path ok rate follow this steps

  1. calculate success count , use query like: category: path1 AND label: success
  2. caculate fail count ,use query like: category: path1 AND label: fail
  3. use transform add field from calculation to get total count ,like total = success + fail
  4. use transform to caculate ok rate, like ok_rate = success/ total

but how to show different path ok rate in one graph, path group by category