Along the lines of thought given here, is it in general possible to substitute a summation over a function $f$ of primes like the following: $$ \sum_{p\le x}f(p)=\int_2^x f(t) d(\pi(t))\tag{1} $$ and further $$ \int_2^x f(t) d(\pi(t))=f(t)\pi(t)\biggr|_2^{x}-\int_2^{x}f'(t)\pi(t)dt\tag{2}. $$
If it's possible only for some cases, how can one specify them? answered in the comments
Let's continue from $(2)$ with an representation of the prime counting function: $$ \pi(t) = \operatorname{R}(t^1) - \sum_{\rho}\operatorname{R}(t^{\rho}) \tag{3} $$ with $ \operatorname{R}(u) = \sum_{n=1}^{\infty} \frac{ \mu (n)}{n} \operatorname{li}(u^{1/n})$ (the so-called Riemann's ${\rm R}$ Function, see e.g. $(11)$ here) and $\rho$ running over all the zeros (trivial and non-trivial) of $\zeta$ function. $\operatorname{li}(\cdot)$ is the logarithmic integral.
So we have $$ \begin{eqnarray} &=&f(t)\pi(t)\biggr|_2^{x}-\int_2^{x}f'(t)\pi(t)dt\\ &=&f(t)\left(\operatorname{R}(t^1) - \sum_{\rho}\operatorname{R}(t^{\rho})\right)\biggr|_2^{x} -\int_2^{x}f'(t)\left(\operatorname{R}(t^1) - \sum_{\rho}\operatorname{R}(t^{\rho})\right)dt \phantom{somemorerspace}\\ &\phantom{AA}&\\ &=&\sum_{n=1}^{\infty}\frac{ \mu (n)}{n}\Big\{\left[f(t)\left( \sum_{z\in\{1,\rho\}} (-1)^{1-\delta_{1z}} \operatorname{li}(t^{z/n})\right)\right]_2^{x}\\ &&- \int_2^{x}f'(t)\left( \sum_{z\in\{1,\rho\}} (-1)^{1-\delta_{1z}} \operatorname{li}(t^{z/n})\right)dt\Big\}\\ &\phantom{AA}&\\ &=&\sum_{n=1}^{\infty}\frac{ \mu (n)}{n}\sum_{z\in\{1,\rho\}}(-1)^{1-\delta_{1z}}\left\{\left[f(t)\left( \operatorname{li}(t^{z/n})\right)\right]_2^{x} - \int_2^{x}f'(t)\left( \operatorname{li}(t^{z/n})\right)dt\right\}\hskip0.9in(4) \end{eqnarray} $$ where I tried to combine the sum a little without introducing to much confusion by using $$ (-1)^{1-\delta_{1z}}= \cases{ +1&$ \text{if } z=1$\\ -1&$ \text{if } z=\rho$\\ } $$
Now, what if we just take an approximation $\tilde{\pi}(t)$, where the sums over $n$ and $\rho$ are truncated. Is this approach still valid? I'm worried because $\tilde{\pi}(t)$ might not be monotone, which is a prerequisite of the Lebesgue-Stieltjes integration. Let's work out the last integral, by parts: We use $$ \int_2^{x}f'(t) \operatorname{li}(t^{w})dt =\left[ f(t)\operatorname{li}(t^{w}) \right]_2^x - \int_2^x \frac{f(t)wt^{w-1}}{\ln(t^w)}dt \tag{5} $$ which gives a nice result when $f(t)=t^{-s}$, see here: $$ \int_2^{x}(-st^{-s-1}) \operatorname{li}(t^{w})dt =\left[ t^{-s}\operatorname{li}(t^{w}) \right]_2^x - \int_2^x \frac{t^{-s}t^{w-1}}{\ln(t)}dt =\left[ t^{-s}\operatorname{li}(t^{w}) \right]_2^x - \left[{\rm li}(t^{w-s})\right]^x_2. $$
So overall we get $$ \sum_{n=1}^{\infty}\frac{ \mu (n)}{n}\sum_{z\in\{1,\rho\}}(-1)^{1-\delta_{1z}}\left\{\left[f(t) \operatorname{li}(t^{z/n})\right]_2^{x}- \left[ f(t)\operatorname{li}(t^{z/n}) \right]_2^x +\int_2^x \frac{zf(t)t^{z/n-1}}{n\ln(t^{z/n})}dt \right\}\\ =\sum_{n=1}^{\infty}\frac{ \mu (n)}{n}\sum_{z\in\{1,\rho\}}(-1)^{1-\delta_{1z}}\left\{\int_2^x \frac{f(t)t^{z/n-1}}{\ln(t)}dt \right\}\tag{6}\\ $$ and in the special case $f(t)=t^{-s}$ this simplifies to $$ P_\color{red}x(\color{blue}s)=\sum_{p<\color{red}x} \frac{1}{p^s} =\sum_{n=1}^{\infty}\frac{ \mu (n)}{n}\sum_{z\in\{1,\rho\}}(-1)^{1-\delta_{1z}} \left[ {\rm li}(t^{\frac zn-\color{blue}s}) \right]^{\color{red}x}_2 \tag{7} $$
(for the interested reader: the story continues here...)
If anybody could confirm this, it would be ever so cool.
Thanks for your help and your time for reading all this,