Vitamin D

Has anyone who had a miscarriage found out that they had a vitamin D deficiency? I heard it has been linked to miscarriage so I got mine tested a few months after my miscarriage, and I was almost critically low. Wondering if that could have had anything to do with it?