OK, if you are in the d block (transition metals), then the d electrons and the highest s electrons are the valence electrons. So for Ni, the two 4s electrons and the eight 3d electrons are the valence electrons => 10 is the answer.
But, if you are in the heavy p block region, the d orbitals don't count (because the d orbitals are too low in energy, core-like, to contribute to bonding in this region of the periodic table). For example, Br has two 4s electrons, ten 3d, and five 4p. The ten 3d are 'core-like', so valence electrons = two 4s and five 4p => 7 valence electrons for Br.