Source: Warhammer Armies Project: Unofficial 9th Edition (v2.2)

Nearby Friend Annihilated
URL Copied!

If a unit that started the phase with Unit Strength 10 or more is destroyed for any reason, all friendly units within 6" must immediately test for panic.

This covers situations such as when a unit is wiped out by missile fire, magic, close combat, pursuit or indeed any other occurrence. Obviously, it's best to leave the annihilated unit in place until the tests are taken in order to give a point to measure from.

panic-nearby-friend-annihilated
The middle blue unit has been destroyed in close combat. All friendly units within 6" must immediately test for Panic — the destroyed unit is left in place until the tests are made to ensure an accurate measurement.

Previous - Heavy Casualties

Next - Nearby Friend Breaks