Hello there, I have the same problem as yours. I was trying to use a defined dashboard variable in value mappings in my stat panel, but it just didn’t work. However, I read the official documentation of value mapping and it says that value mapping accepts variables, which is pretty confusing. Have you figured out this problem? Is it us that use variables incorrectly or it is actually a function that had not yet been added to Grafana?
Thanks. So I had a chance to talk with the developers and after looking in more detail inside the code it is not possible to what you want to achieve as Variables are not supported inside value mappings.
From the code, it treats it as text so will not work.
Also, cross-referenced with the documentation and it does also say anything which supports Variables.
There was already a question on this topic recently on this post which seems to have the same answer by the member.