The formation energy, structure relaxation and electronic structure of Y-doped Mg2Si are investigated by the density functional methods. Y atoms are expected to be primarily located at the Mg sites in Y-doped Mg2Si. The Si atoms around the impurity outward relax relative to the Y. Doping makes non-degenerate semiconductor Mg2Si transfer to degenerate semiconductor Mg7Si4Y. The electronic structure of Mg2Si is complicated after doping, such increased complexity by Y doping can improve the Seebeck coefficient of Mg2Si significantly.