The entire book The Calling is about Orlesian Warden-Commander Genevieve trying to save her brother Bregan, who went on his Calling, but knows where the Old Gods are.
During the book, it is revealed that Duncan killed Genevieve's fiancé (gender of that word may be wrong... her future husband) and she wanted him to suffer, and thought he'd die during the Joining.
Duncan was a common thief before he became the Warden. Then he slit a Warden's throat (he didn't even really want to, as far as I remember) and a senior Warden put him through he Joining as vengeance. Except he survived the Joining and became a Warden himself. In the Epilogue of The Calling, he becomes the second in command of Wardens in Ferelden, while Fiona deposits Alistair with Maric and leaves for Weisshaupt.
The Calling is about 20 years before Origins, so he was still a relatively fresh Warden back then. Eventually, the Warden-Commander went on their own Calling or died, and he assumed the post of Commander of the Grey in Ferelden. That's what he is in Origins.