The previous experimental work showed that Hf- or Zr-doping has remarkably improved the thermoelectric performance of FeNbSb. Here, the first-principles method was used to explore the possible reason for such phenomenon. The substitution of X (Zr/Hf) atoms at Nb sites increases effective hole-pockets, total density of states near the Fermi level (EF), and hole mobility to largely enhance electrical conductivity. It is mainly due to the shifting the EF to lower energy and the nearest Fe atoms around X atoms supplying more d-states to hybrid with X d-states at the vicinity of the EF. Moreover, we find that the X atoms indirectly affect the charge distribution around Nb atoms via their nearest Fe atoms, resulting in the reduced energy difference in the valence band edge, contributing to enhanced Seebeck coefficients. In addition, the further Bader charge analysis shows that the reason of more holes by Hf-doping than Zr in the experiment is most likely derived from Hf atoms losing less electrons and the stronger hybridization between Hf atoms and their nearest Fe atoms. Furthermore, we predict that Hf/Sn co-doping may be an effective strategy to further optimize the thermoelectric performance of half-Heusler (HH) compounds.