How to visualize different graphs according to a drop down variable?

The data is being consumed by custom Prometheus exporter working on a central host and collecting data from multiple hosts under the centralized host’s maintenance

About the queries, of course, providing 2 example queries below (1 for host and 1 for database) with some explanation

Host
Memory{metric=“FreeMemPct”, target_name=~“$target_name”}
(optionally I tried adding the following: target_type=“host”)
The idea is to show according to the target name the free memory for that host

Database
DB_service{metric=“DB_time”, target_name=~“$target_name”}
(optionally I tried adding the following: target_type=“host”)
The goal is to show the time each database has been up and running according to the target name chosen

The variable target_name is a variable implemented in Grafana

I had 2 ideas:

  1. Implement a way to “show” a row of panels when choosing a specific target_type as mentioned in the original question
  2. Create “dependent” variables target_name & target_type and depending on the target type you choose only specific target_names appear

The present question is for the first idea, but if someone believes the second is easier or more worthwhile implementing, I am open to discussion
I found a couple of Grafana docs about dependent variables (Two variables that are dependent on each other - #2 by mattabrams & Add and manage variables | Grafana documentation )
But they didn’t answer my question or help with 100% implementation on my side