Create Templating variable using groupby in label_values

Hi,
Running “group by (label_application_service_name) (kube_namespace_labels)” in prometheus produces results, How can I (is it possible to) create a templating variable in Grafana using similar query with label_values ?
Something like

label_values(groupby (label_application_service_name) (kube_namespace_labels), ServiceName)

Thanks
Raj