Change display variable in dashboard

Hello!
Is it possible to change display variable in one metric with label from another metric?
For example I got this metric that I want to graph:
ping_rtt_ms{target=~"$target"}
and $target = ip address of the host.
I didn’t want to see ip address, that’s confused and not clear as display variable.
But I got another metric up{instance=~"$target"} that contains real_hostname in labels.
I try to do it with join transform but no luck.