Many myths about vitamins being bad for erectile function have been dispelled. Some have pointed to vitamin D as a culprit of erectile dysfunction. In most cases, the ED in those on vitamin D supplements is due to a corresponding magnesium deficit. In these cases, ED is ameliorated with magnesium supplementation.