You can refer to this post for a real time statistic block to calculate RMS and Mean continuously. The idea was originated from @bordodynov and I modify it a bit and built into a subckt symbol.
https://forum.qorvo.com/t/behavioral-true-rms-to-dc-converter/21726/3
This symbol can be download from my Github (Github : Stat-RealTime.qsym)
and this is an example schematic to demonstrate its performance. With this, you should have all information to study how this math works… it rely on delay() function, so, a bit tricky approach and can be heavy computational.
example2.Stat-RealTime.qsch (4.2 KB)
HOWEVER, your question is Cycle by Cycle results… this requires math to sync with your switching signal, and I think the only way to do it is to write a DLL block for such purpose. The statistic information should calculate during each switching period, and update the output at end of each switching period, and then next. I think it possible but I expect you have to be good at DLL block (C++ block) in order to do it.