The short-circuit impedance is made up of the contributions from the upstream grid, the transformer and the cables. All values must be referred to the same voltage level. Strictly speaking, the resistive and reactive components are added separately, and only then is the magnitude calculated. Near the transformer, its impedance predominates; at the end of long cables, the cable impedance predominates.
Example from the book
Transformer 630kVA, uk=4%, 400V: ZT=0.04⋅4002/630000Ω=10.2mΩ. Upstream grid with 250MVA: ZQ=1.1⋅4002/(250⋅106)Ω=0.7mΩ. The grid plays hardly any role compared with the transformer.
Formelsammlung Strom · Erik Schmidt · Formula 27.9