The card PoS's come in two forms; one that only takes the Danish Dankort (which is the cheaper) and one that also accepts foreign cards.
Which is why merchants in Denmark - at least smaller ones - are still weary about upgrading to the fancy PoS, and therefore need to accept cash some times. Sure, there are alternatives to that, like MobilePay. But usually your problem will be with tourists, who don't have access to that, nor access to a Danish card, and can only pay cash. (Another good reason why governments won't abandon cash; they'd lose a lot of tourists too.)
I don't know whether PoS's are cheaper in Sweden than in Denmark, but generally speaking, Danes and Swedes have about the same level of trust in government, yet there are far more cash transactions in Denmark compared to Sweden.