Filter label_value function with query on value

This question has already been asked, but instead a work around has been given.

This generates output
label_values(libvirt_domain_state_code{instance=~"$instance"} , domain)

This is a valid prometheus query that generates output
libvirt_domain_state_code{instance=~"xxx"} == 1

However this does not work
label_values(libvirt_domain_state_code{instance=~"$instance"}==1 , domain)