$$\text{E}[X] = \frac{\int x \, P(y_i \mid x) \, dx}{\int P(y_i \mid x) \, dx}$$
is not a general statement, but only a first step in expectation propagation (EP). EP tries to approximate a posterior distribution $P(x \mid \mathcal{D})$ using a given factorization of the joint,
$$P(x) \prod_i P(y_i \mid x).$$
To reduce clutter, the dependency on the data $\mathcal{D} = \{ y_1, ..., y_n \}$ is often dropped in the notation. Instead of a posterior distribution, it might actually be less confusing to just think about approximating any distribution whose unnormalized density is given by
$$\phi_0(x) \prod_i \phi_i(x).$$
The first moment of the true distribution would be
$$\text{E}[X] = \int x \, P(x) \, dx = \frac{\int x \, \phi_0(x) \prod_i \phi_i(x) \, dx}{\int \phi_0(x) \prod_i \phi_i(x) \, dx}.$$
EP works by iteratively refining the distribution with one of the factors and approximating the distribution by only keeping some of the moments.