Simple software low pass filter
A first order lowpass filter is usually implemented like this:

$$p[n] = \alpha p[n-1] + (1-\alpha) pi[n]$$

Where $p[n]$ is your filtered power estimation, $p[n-1]$ is the previous result, $pi[n]$ is your new measurement (probably the product of instantaneous voltage and current measurements), and $\alpha$ is a positive parameter just less than 1.

The nearer $\alpha$ gets to 1, the larger the time constant (lower cutoff frequency) of your filter. But beware, especially in embedded systems with limited precision, that getting too near to 1 can make your filter unstable, or at least have problems due to numerical precision.

The cutoff frequency for that filter is around $f_s \frac{1-\alpha}{2\pi\alpha}$, where $f_s$ is your sampling frequency.