Suffering from iron deficiency which caused anxiety, panic attacks until diagnosed

I’ve had low ferritin and vitamin D levels, causing panic attacks and dizziness. I’m taking iron supplements and eating iron-rich foods, but still feel dizzy and anxious. Has anyone else experienced this? How long did it take to feel better? Thanks for any advice!