Use the group number to determine the charge on an ion derived from each element.

Potassium:
Part 2 of 4
Barium:
Part 3 of 4
Iodine:
Part 4 of 4
Nitrogen

Potassium: Group number 1. The charge on a potassium ion is +1.

Barium: Group number 2. The charge on a barium ion is +2.
Iodine: Group number 17. The charge on an iodine ion is -1.
Nitrogen: Group number 15. The charge on a nitrogen ion is -3.