Max and min functions

Does this help?

https://forum.qorvo.com/t/rms-average-of-a-waveform/16847/2

But @ivan1 recommendation in using .meas can make it automatic and save a few click.