In Parsha Ki Tisa, "when you take a census" - the counting can not be a head counting but every one has to give a shekel and the shekels are counted. But in Parsha Pinchas - "take a census of the entire assembly" the actual heads were counted. Why the difference?? It seems that now head counting is allowed where as previously, head counting iso the shekel count would lead to a plague.
The commentators explain that the census of Pinchas was in the same method of Ki Tisa, using the half shekel for counting, as it states there "As Hashem commanded Moshe". (See Ha'amek Davar Bamidbar 26, 4)