Erectile dysfunction that comes on gradually often points to causes that involve blood flow or nerves. On the other hand, a sudden loss of sexual desire or the ability to have erections usually suggests that a medication or psychological difficulty, such as depression or stress. may be to blame.