Dr. Mercola and others have created a wonderful document. Read the whole thing here (recommended):
Here are some excerpts and graphs:
"Since over half the population does not get enough magnesium, and far more are likely deficient,31 magnesium supplementation is recommended when taking vitamin D supplements.
This is because magnesium helps to activate vitamin D, as the enzymes that metabolize vitamin D in the liver and kidneys require magnesium.32 In fact, about half of those taking vitamin D supplements are unable to normalize their vitamin D levels until they take magnesium.33-35
Those who do not take supplemental magnesium need, on average, 146% more vitamin D to achieve a blood level of 40 ng/ml (100 nmol/L), compared to those who take at least 400 mg of magnesium per day. "
Read it all, It’s well done and useful.