You can test if the cable has gone bad by using another Thunderbolt cable. Plug it going out of the iMac and into the Thunderbolt port on the back of the display.
open