For a general salt of type $A_x B_y$, the shortcut formula for the solubility product in terms of solubility $S$ is:
\[ K_{sp} = x^x y^y S^{(x+y)} \]
For $Mg_3(PO_4)_2$, $x=3$ and $y=2$. Thus, $3^3 \cdot 2^2 \cdot S^{(3+2)} = 27 \cdot 4 \cdot S^5 = 108S^5$.