Cannot change mean() to last() through GUI

Very much a noob here. I’m using Grafana to plot my weight from body composition scales. Consequently I want the numbers to be exact. In the GUI it shows it is using mean(), but clicking on it only allows “remove”.

So I changed to the text editor and changed mean() to last() as shown below:

SELECT last("value") FROM "kg" WHERE ("entity_id" = 'michael_s_weight') AND $timeFilter GROUP BY time($__interval) fill(none)

If I then exit the text editor, it changes back to mean(). I also tried “Apply” after making the change in the text editor. Once I edit the panel again it returns to the text editor and shows last(), but once again when I return to the GUI it reverts to mean().

Being new to this I’m probably doing something wrong, and this is my first foray into the forums, so my search skills are not yet up to scratch. What am I doing wrong?

Ok, so now I know a bit better, I can answer my own question.

It seems that the “Toggle text edit mode” is not two-way. If you make changes in the GUI and toggle, you will see those changes. But if you make changes in text edit mode and toggle, those changes will not be reflected in the GUI.

Furthermore, when you click on mean() in the GUI, the only option is to remove it. This is what you should do. Then click on the “+” and find last() under “Selectors” and add it. Lo and behold, last instead of mean.