I've dealt with this problem at work pretty frequently, and every time it has been the cable. Even if it's plugged in correctly, they just seem to wear out/can't handle windows 10, and yet pairing a bad cord with a different monitor can sometimes temporarily solve the issue which can make you think the cord is fine. I can say this pretty confidently because I was dealing with 6+ computers all with flickering issues once we switched to Windows 10, and changing the cords has fixed all of them.
Check the cable. Take it out of the sockets at both ends, and plug it back in. If that doesn't work, try another cable you know works if you can get one. If the problem still occurs, it's probably the monitor. You can try connecting it to another computer, or connecting another monitor to your pc.