Show tag values From MyData with key = FailureCode ORDER BY time DESC Not working

when I use the Show Tag Values Query on grafana, I can’t order the values of the data by time. Whether I use order by time asc or order by time desc I get the same result under template variables. My question is, is there anyway I can arrange values of tags by time (either asc or desc) in the template variable.

I will appreciate an answer.

Many Thanks.