This is to connect Displayport-out to HDMI-in. Your iMac displayport connection is an output.
If you are trying to connect to a monitor, then this will not work. the HDMI cable has to go to the display, the Displayport connection has to connect to the video source.