Distinct count includes "blank", so you'll have to write your own measure field, try something like
=CALCULATE(DISTINCTCOUNT(Table1[teacher]), NOT(ISBLANK(Table1[teacher])))
Then select that field instead of Distinct Count of teacher.