What should go to infinity in power's formula N or the repetition KN?
For periodic signals you can use
$$P_y=\frac{1}{N}\sum_{n=0}^{N-1}|y[n]|^2\tag{1}$$
where $N$ is the period of the signal. I'm sure you can take it from here.
Also take a look at this question and its answer where the equivalence of $(1)$ and the formula in your question is discussed.