I struggled with my decision to buy an iMac, because it was so expensive, but at the end of the day, I felt, I was getting value for my money. For me, a 5k 27" display plus a desktop (Dell) would run me close to 3k, because of the high cost of the 5k display. Did I need a 5k display, no but comparing apples to apples, I got a fantastic computer for 2k.
With that said, I opted for a SurfaceBook for my laptop, because I got more bang for my buck, and its been great. I've been using it extensively this week as I'm away on a business trip
Just wait until some major component breaks, and the system is out of warranty. That repair (combined with the original price of the system) is going to cost you more than the Dell and the separate 5k screen combined.
I put together a miniITX system with a 4k 27" screen on PCPartPicker, and it costs $1600 less than an equally equipped iMac. Sure a 5k screen might add more to the total cost, but even then the custom built would be less, and you'd have the ability to swap any part out for much less than what Apple charges.