It might be an idea off too much Crusader Kings 2, so bare with me on this. Magnus the Strong of Sweden was the only son of Niels of Denmark and Margret Fredkulla daughter Inge the Elder of Sweden which basically gave Magnus a decent claim to the throne of Sweden.
However there was issue his father Neils apparently thought Kund Lavard who was Neils nephew who had close ties to the Holy Roman Empire, was aiming to take the throne of Denmark, and either had Magnus kill him or Neils did it himself.
So given all of this is there anyway to make an earlier union between Denmark and Sweden not also happen but actually last? Although I do have admit serious ignorance to Scandinavian politics of the era, the kings did seemed to be elected.
However there was issue his father Neils apparently thought Kund Lavard who was Neils nephew who had close ties to the Holy Roman Empire, was aiming to take the throne of Denmark, and either had Magnus kill him or Neils did it himself.
So given all of this is there anyway to make an earlier union between Denmark and Sweden not also happen but actually last? Although I do have admit serious ignorance to Scandinavian politics of the era, the kings did seemed to be elected.