How to reference a single query from another panel? (not all)

I am trying to utilize the ‘query sharing’ method in Grafana to setup all my queries in 1 panel - and then reference these via separate individual panels. Being able to do this is critical for my dashboard performance.

For this case I’m using the SimpleJSON datasource plugin and in my ‘Query Panel’ I have defined two individual queries. One query should be used by Panel 1 and the other by Panel 2.

However, when I select Panel 1 and set the data source to Dashboard, I am only able to reference both of the queries from my Query Panel - not one or the other. This seems counter-intuitive, so I’m hoping there is a way to specifically select queries per panel.

My Query Panel:

My Panel 1 (where I cannot select e.g. the query all_variables as I would like to):

@martinfalch there’s a transform that I think will help you out here.

Click on the transform tab, then find the transform called filter data by query, here you can select the queries you want to include from the other panel

Screen Shot 2022-03-15 at 7.22.55 PM