Sometimes the value of template variable isn't displayed correctly on panel

I defined a template variable named “tenant” as below, in which “my_call_count” is a prometheus metrics of the type counter,
label_values(my_call_count, tenantid)
All the values can be listed successfully at the top of the dashboard.

Afterwards, I created a Singlestat panel, and set the title of the panel as $tenant. What I expected was that the selected vlaue should be displayed as the title of the panel singlestat. Sometimes it worked; but sometimes, it didn’t, the string “$tenant” instead of the value was displayed directly. Can you please advise how to debug this issue?

Grafana version: v4.6.2
Datasource: Prometheus
OS on which running grafana: Oracle Linux Server release 7.3

I found that the issue happened each time when there were some empty tenantid. So the workaround is to make sure there are never any empty tenantid.