Apple uses a custom SSD design which is different than the M.2 standard. So the bottomline here is the Samsung 970 EVO PCIe/NVMe SSD won’t work in your system. Here’s a good reference on the Apple SSD’s The Ultimate Guide to Apple’s Proprietary SSDs
As it turns out Samsung was contracted to make the custom Apple SSD’s and here is the drive you’ll want 768GB SSD It’s the largest blade mSATA SSD your system will support. Here’s the guide you’ll need to follow to install it iMac Intel 27" EMC 2546 Blade SSD Replacement
Sorry your system can’t support the newer PCIe/NVMe drives.
If you really need this much storage your other option is to replace the 3.5” HDD with a larger 2.5” SSD drive. The prices for SATA SSD’s has dropped quite a lot and you can pickup a 2 TB or even a 4 TB without needing to rob a bank.
The last option is to forgo the internal drive and just go with an external Thunderbolt RAID drive.
If you really want more performance than what SATA offers internally you’ll need to upgrade to a newer iMac which supports PCIe/NVMe blade drives. Take the time to review the guide I linked above for more details.