A direct analysis for Ca2+ with ethylenediaminetetraacetic acid (EDTA), which we represent here as Y4-.
Ca2+(aq) + Y4+(aq) ⇌ CaY2-(aq)
Unfortunately, for most samples this titration does not have a useful indicator. Instead, we react the Ca2+ with an excess of MgY2-.
Titration of Mg2+ with EDTA:
Mg2+(aq) + Y4-(aq) ⇌ MgY2-(aq)
Ca2+(aq) + MgY2-(aq) ⇌ CaY2-(aq) + Mg2+(aq)
The amount of the released Mg2+ is equivalent to the amount of Ca2+ in the sample.
The amount of EDTA used in the titration provides an indirect measure of the amount of Ca2+ in the original sample.