Sort bar gauge by value with multiple measurements

Hello all,

I am plotting a bar gauge with several measures, and would like to sort it by value (at the moment it seems to be sorted by name).

You can see the format of my query and data in the pictures below.
Any idea how I could solve this?



2023 04 27 _ grafana parettos issue 3
2023 04 27 _ grafana parettos issue 4