Key-Value Variable Displays Key Before Interacting with the Variable

I’ve encountered a bug in Grafana regarding a variable with key-value pairs. I have a custom variable named Resolution with the following key-value pairs:

Hourly : CAST(CONVERT(date, a.[date]) AS datetime)
Daily : date

In my query, I use this variable as follows:

${Resolution:value} AS ‘time’,

However, when I enter the dashboard for the first time, it displays the key (e.g., ‘Hourly’) instead of the corresponding value. Strangely, when I manually change the value, it displays correctly.

I’ve tried searching for solutions, but unfortunately, I haven’t found any. How can I fix this issue?

Thank you for your assistance.

Not a bug

CAST(CONVERT(date, a.[date]) AS datetime) as __text
date as __value

That sounds like you have saved wrong default value for that variable. (or you have wrong variable value in URL, so Grafana will use value from URL get parameter).

Edit dashboard json model, remove default value for your variable and then select right value and save also variable values.