Impact Resonance deals X damage divided as you choose among any number of target creatures, where X is the greatest amount of damage dealt by a source to a permanent or player this turn.
You determine the value for X and announce how damage will be divided as you cast Impact Resonance. Each chosen target must receive at least 1 damage. Once the value of X is determined, it won’t change, even if a source deals a greater amount of damage before Impact Resonance resolves. (Most of the time, the value of X in an effect would be determined only as the spell resolves. However, the rules state that if damage needs to be “divided,” that information is checked as the spell is put on the stack.)
Impact Resonance looks at the entire turn to see the greatest amount of damage dealt from a single source to a single permanent or player. For example, if the only damage dealt during the turn was Earthquake, which dealt 5 damage to each of four creatures and two players, then X is 5.
If Impact Resonance has multiple targets, and some, but not all, of them become illegal before Impact Resonance resolves, Impact Resonance will still deal damage to the remaining legal targets according to the original damage division.