In an uncharged compound, the total oxidation state must be zero. The oxidation state of the calcium is +2, thus we get the following formula, where x is the oxidation state of the polyatomic ion X:
Also, it is known that potassium has an oxidation state of +1. Since the new compound also has a total oxidation state equal to zero, we get the following equation, where k is the number of K atoms:
That's how it is found that the compumd consists of 2 K+ ions and one X ion.