From 1992 to 1994 she worked as a teacher, until Prime MinisterIngvar Carlsson made her Minister for Schools in his government. In 1998, she and the then Minister for Finance Erik Åsbrink announced their wish to "publicly confirm that we are in love" and their intention to separate from their respective partners. Soon afterwards, Ylva Johansson left the government. The following years, she worked in the private sector.

In 2004, Prime Minister Göran Persson appointed Ylva Johansson to the government in a new position, as Minister for Health and Elderly Care, succeeding Lars Engqvist.

She has two children with her former husband Bo Hammar and a son with Erik Åsbrink.