Both calcium hydrogen carbonate and magnesium hydrogen carbonate react with soap to produce scum
CA(hco3)2 (aq) + 2NAST (aq) --> CAST2 (s) + 2NAHCO3 (aq)
calcium hydrogen carbonate scum (calcium stearate)
MG(HCO3)2 (aq) + 2NAST (aq) --> MGST2 (s) +2NAHCO3 (aq)
Magnesium hydrogen carbonate magnesium stearate