Set different maximum values for each field in the Bar Gauge

Hello,

I was trying to set up a dashboard so that I could monitor the number of messages within certain queues. The problem is that in order to create a suitable alert I need to set a maximum value for each of them.
The number of queues is really high so it is impossible to set this value manually, so I thought of retrieving it through another query.
At this point I don’t know how to apply this second query to the first one in order to achieve the desired result.