Margaret succeeded in having her son Olaf recognized as heir to the throne of Denmark. She was a daughter of King Valdemar IV and had married King Haakon VI of Norway and Sweden, who was the son of King Magnus IV of Sweden, Norway and Scania.
More personally, it was achieved by Queen Margaret I of Denmark (1353–1412). The union was the work of Scandinavian aristocracy wishing to counter the influence of the Hanseatic League.