one method is to obtain the percentage composition from the chemical formula. Examing Ca(NO3)2, we can deduce that one mole of calcium nitrate contains 1 mole of calcium, 2 mole of nitrogen atoms and 6 moles of oxygen atoms.
taking a basis of one mole,
total mass = 1 x Mr = 104g
mass of Ca = 1mol x 40g/mol = 40g
percentage composition of Ca = 40/104 x 100%