This symptom often leads to a logic board power issue. Likely a tantalum capacitor has failed within one of the power rails. Often times you can see visible damage in one of the caps which are in a row sizable blackish grey or yellow blocky rectangle SMD device with one side edge beveled or marked with a line to show its polarity.
Unless you have the tools and experience micro soldering its likely best to seek out someone with deeper iMac repair skills.