This Frank Loesser and Frederick Hollander number was originally performed by Marlene Dietrich in the 1939 western Destry Rides Again in a scene in which she jumped on the bar of the Last Chance saloon and sung the song. It became a standard part of her repertoire, second only to "Lili Marlene."
Dietrich's spirited rendering of this song inspired British Minister of Aircraft Production, Lord Beaverbrook, in a March 1941 speech in which he paid tribute to his research department who were contributing much in the Second World War. He said: "Now who is responsible for this work of development on which so much depends? To whom must the praise be given? To the boys in the back rooms. They do not sit in the limelight. But they are the men who do all the work." Beaverbrook said that Dietrich singing the song was a greater work of art than the Mona Lisa. From then on the term "backroom boys" was used for the unpublicized research scientists and technicians in the Second World War and subsequently to any boffins of this kind.
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."