Being born in a village Hajwair, near Ghazni suffix of Hajwairi is also added to his name. The depth of his religious knowledge and extra ordinary academic genius is reflected in one of his great works, Kashfful-Mahjub. He traveled extensively through Azerbaijan, Baghdad, Damascus, Tabristan and Turkistan to follow the part of devotion and received spiritual blessings from great scholars and mystics. He came to stay at Lahore during the days of Sultan Mahmood of Ghazni and devoted himself to writing of scholarly works and propagation of Islam.
Thousands of people received guidance from him and embraced Islam including a ruler of Lahore. One of the important works which assumed historical significance is Data Saheb initiated the construction of a mosque at Lahore which is said to be the first such in the land. He paid the entire expenses of the construction from his pocket and made the mosque a centre for teaching of the Holy Quran and Arabic language.
He has a very high place among mystics and scholars of the sub-continent and sages like Khwaja Moinudin of Ajmer and Khwaja Fariduddin Ganj Shakar, who underwent seclusion prayers at his tomb and received spiritual elevation. It is said that after receiving blessings, Khwaja Ajmeri before leaving his tomb recited a Persian couplet which is now engraved on his tomb, translation:
“Gunj Bakhsh the spiritual leader is a blessing for the whole world and menifester of the Divine light;
he is perfect guide for spiritual way-farers and a leader among sages.”