Assuming this is indeed a story by Asimov (and not by some other writer who might have had the same idea), it wouldn't be that old. Asimov introduced the idea of the zeroth law implicitly in a Susan Calvin short story, “The Evitable Conflict”, in 1950. The world is managed by the Machines, robots which act for humanity as a whole, and who consider humans on a statistical basis, so that they interpret the First Law as regarding humanity as a whole rather than individual humans.
However, according to both my knowledge and Wikipedia's, Asimov didn't formulate this as a separate Zeroth Law until much later, in the novel Robots and Empire, published in 1985, which tied his Foundation and Empire universe with his Robots universe. In Robots and Empire, R. Daneel and R. Giskard are confronted with moral dilemmas that lead them to formulate the Zeroth Law.
A robot may not injure humanity, or through inaction, allow humanity to come to harm.
Violating the First Law to obey the Zeroth Law causes Giskard to die
after he causes the Earth to become uninhabitable, but Daneel lives on to turn out to be the mastermind behind the Empire, the Foundations, and Gaia.
If the story you describe is in Asimov's cycle, it would have to be in his late Foundations sequels (which I haven't read, so I can't confirm), probably Foundation and Earth, which is where
Daneel's involvement is revealed.
It's quite possible that other writers either came up with the same Zeroth Law independently, or picked up the hints in “The Evitable Conflict” and in the first Robots novel The Caves of Steel where the idea is also discussed indirectly (and a translator even expressed the idea in the form of an amendment to the First Law).