The story of Dasharatha & Shani is also mentioned in Padma Purana’s Uttara Khanda. The story is a discussion between Narada Maharshi and Mahadeva.
Sage Narada curiously asked Lord Mahadeva as to what made Shani such a volatile planet.
Lord Mahadeva replied — Shani is extremely violent by nature and everybody is scarred of this planet. Once, the royal astrologer of Dasharath was petrified at the prospect of Shani entering the constellation of Rohini and warned him of its dire consequences. ‘If the Shani is not prevented from entering Rohini, then famine would occur lasting for more than twelve years.’ said the royal astrologers.
Dasharath went above the sky to subdue the might of Shani well armed with divine weapons. Shani became terrified on seeing Dasharath in such a menacing mood and expressed his willingness to fulfil his desires.