For regular geometry and linear shaped molecules dipole moment is always zero. It depends upon the direction of the polar bond. The direction of dipole moment is similar to the flow of electrons in the polar bond.
CO2μ=0CH4μ=0NH3μ=1.47DNF3μ=0.23D