Thinking about more than androgenic alopecia, vitamin D deficiencies effect many areas of health. Correcting a vitamin D deficiency would benefit you in many ways.
For what it's worth I had a vitamin D test before summer, then had generous sun exposure over summer, at least around 5 hours at least of 90 percent body exposure per week. My vitamin D levels were unchanged with my following blood test. Also, if you have daily washing routine you may be washing any vitamin D off your skin.
It is up to you however, to do what you what with this information, it is your health. I hope you get this worked out.
I wish it was that simple, I can provide you plenty of links to forums where people had MPB and tried vitamin D without success. There is clearly a problem with androgens. I'm VERY hairy for a guy who is 21 yo. So my hair can't handle those androgens. I wish that we already had found something which works as well as finasteride without messing you up. I actually had a dream yesterday that i took finasteride pill, hahaha. So sad.