What kind of milk powder is your baby drinking?
When my child has diarrhoea, I give her Abbott soya milk base milk. After she has recovered, she goes back to pediasure/gain iq.
Your baby's constipation could either be milk powder that's unsuitable for her that resulted in constipation OR the medicine that suppose to help her diarrhoea has cured her stool and now somehow has harden it. So stop the medicine and if you have then perhaps you should look into her milk powder.