Erectile dysfunction occurs when you can't get an erection or can't keep a firm enough erection to have sex. Having mild or moderate erectile dysfunction is common — it affects about half of men at ...