Doping is one of the most powerful tools for tuning the electronic properties of functional materials. Well known examples include doped semiconductors and the Cu and Fe based high temperature superconductors. Besides introducing charge carriers and chemical pressure, it is almost inevitable that dopants will introduce quenched disorder into the system. This can have a wide range of consequences for the electronic structure, such as electric and thermal resistance, a deformation of the nodal structure of a superconductor or Anderson localization. In this thesis the influence of disordered dopants is studied by calculating the configuration-averaged spectral function <A(k,w)> from first principles within the super cell approximation. To overcome two major problems of the super cell approximation, the band folding and the computational expense, two Wannier function based first principles techniques are developed. The developed methodology is applied to address three realistic materials problems. The first problem is on the influence of disorder on the Fermi surface of NaxCoO2, an important thermoelectric material. The second problem is on the role of oxygen vacancies in the room temperature ferromagnetism in the recently discovered dilute magnetic semiconductor Cu:ZnO. The third problem is on the carrier doping and charge localization in transition metal doped iron based superconductors.