ED can be a direct consequence of cancer itself or a side effect of cancer treatments. The types of cancers most commonly associated with ED include prostate, bladder, colorectal, and testicular cancers. Treatments such as surgery, radiation, and chemotherapy can adversely affect sexual function.