Getting last values for $tag variable

Hi,

I am trying to get last values.
I have built query with grafana, it looks pretty simple:
SELECT last("value") FROM "mes1" WHERE ("tag" =~ /^$tag$/) AND $timeFilter GROUP BY time($__interval) fill(null)

It works when I choose a single variable, but shows incorrect value for multiple or all. How can I make it to show a sum of last values for each selected variable?
Thanks!