Dalton's law is P_{i} = x_{i}P_{tot}, where x_{i} is the mole fraction of component i in the gas phase.

Your other formula is Raoult's law for ideal mixtures, describing the composition of the vapour in equilibrium with a liquid mixture. In this case P_{i} = x_{i}P°_{i}, where P°_{i} is the vapour pressure of pure liquid i, and x_{i} is the mole fraction of i **in the liquid phase**.

The two are related by x_{i}(g) = P_{i}/P_{tot} = x_{i}(l)P°_{i}/Σx_{i}(l)P°_{i}

It is pretty unobservant to say "sometimes I find this formula, sometimes that one". In each case, try to observe the context, what is the situation being described, and what the symbols mean (the same symbol may mean different things in different contexts).