Sexsmith wrote all the lyrics for this song at the Laundromat. He recalled to The Guardian January 17, 2013: " I had the whole lyric done by the time my clothes were dry. All I had to do was fold them up and figure out what to do with the words."
ABBA's Bjorn Ulvaeus and Benny Andersson conceived "Dancing Queen" as a dance song with the working title "Boogaloo," drawing inspiration from the 1974 George McCrae disco hit "Rock Your Baby." Their manager Stig Anderson came up with the title "Dancing Queen."