He came from Pingling 平陵 (close to modern Xianyang 咸陽, Shaanxi) and was a petty official in the office of the Grand Minister of Education (dasitu 大司徒) during the reign of Emperor Ping 漢平帝 (r. 1 BCE-5 CE). Yun Chang belonged to the disciples of the Confucian scholar Wu Zhang 吳章 who was opposed to the growing power of the regent Wang Mang 王莽.
When the regent had Wu Zhang executed, Yun Chang was the only one of his friends who ignored the ban for a decent burial and brought Wu Zhang's corpse to a worthy funeral. Yun Chang was nevertheless appointed Grand Master of Remonstrance (jian dafu 諫大夫). When Wang Mang finally usurped the throne in 8 CE, Yun Chang withdrew from office but later accepted the post of governor (dayin 大尹) of the commandery of Lu 魯, the hometown of Confucius.