The mechanism for the p-n control of AlMgB14-based thermoelectric material was investigated using Rietveld refinement and the first principle calculation. The p- and n-type AlMgB14-based thermoelectric materials were prepared by spark plasma sintering (SPS) with changing raw powder mixture ratio. Temperature dependence of Seebeck coefficient and electrical conductivity were different between the two types of samples. Seebeck coefficient shifted from positive to negative with increasing the number of valence electrons in the metal sites calculated by the metal site occupancy. The density of states and electron density distribution indicated that the electrons transfer from metal atoms to the B atoms.