Count the number of creatures on resolution of the spell and divide X by that number at that time. If the number of creatures changes before resolution, the damage done may be different than what you expected.

Artwork
Loading artwork…
Dwarven Catapult
Fifth Edition · #220 · EN
Nonfoil—Foil—
Card rules
Dwarven Catapult deals X damage divided evenly, rounded down, among all creatures target opponent controls.
"Often greatly outnumbered in battle, dwarves relied on catapults as one means of damaging a large army." —*Sarpadian Empires, vol. IV*
Uncommon · Illustrated by Jeff A. Menges
Format legality
Commander Legal
Duel Legal
Legacy Legal
Oathbreaker Legal
Old School Legal
PreDH Legal
Premodern Legal
Tlr Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Modern Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Penny Not Legal
Pioneer Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
For example, if X is 5 and the targeted opponent controls three creatures, Dwarven Catapult deals 1 damage to each of those creatures.
If the targeted opponent controls more than X creatures, no damage will be dealt to any of them.