Given a finite duration of discrete time domain samples as $x[n]$, the squareconjugate product of each sample $x[n]^2$$|x[n]|^2$ would have both units of energy and units of power, and specifically it can be described as "<_____> Power" given it is the energy at that instant, over the time duration until the next sample.
Using SI units for clarity or explanatory analogy, if we provide the time duration of one sample as $T$ seconds, and $x[n]^2$$|x[n]|^2$ as energy in Joules, then we would have the <_____> power in each sample as $x[n]^2/T$$|x[n]|^2/T$ Joules/sec = Watts. I'll simplify this to the case where $T=1$ seconds such that, in this case, $x[n]^2$$|x[n]|^2$ is both the energy of one sample and the power over one sample duration.
If we sum all the samples for $x[n]^2$$|x[n]|^2$, we get the total energy:
$$E_T = \sum_n x[n]^2$$$$E_T = \sum_n |x[n]|^2$$
$$P_T = \frac{1}{N}\sum_n x[n]^2$$$$P_T = \frac{1}{N}\sum_n |x[n]|^2$$
Similarly, given a finite duration of discrete frequency domain samples as $X[k]$, the squareconjugate product of each sample would have both units of power and units of energy, and specifically it can be described as "<_____> Energy" given it is the power at that location in frequency over the frequency span until the next sample. The result of this is a power spectral density, as the power over some unit of BW.
Using SI units in this case, if we provide the frequency spacing of index $k$ as $B$ Hz, and $X[k]^2$$|X[k]|^2$ as power in Watts, then we would have the "<_____> Energy" in each bin as $X[k]^2/B$ Watts/Hz = Joules. I'll simplify this to the case of $B=1$ Hz, such that, in this case, $X[k]^2$$|X[k]|^2$ is both power of one sample and then energy over the frequency span of one bin.
If we sum all the samples for $X[k]^2$$|X[k]|^2$, we get the total power:
$$P_T = \sum_n X[k]^2$$$$P_T = \sum_n |X[k]|^2$$
$$E_T = N\sum_n X[k]^2$$$$E_T = N\sum_n |X[k]|^2$$
$$E_T = N\sum_n X[k]^2 = N/2 \text{ Joules}$$$$E_T = N\sum_n |X[k]|^2 = N/2 \text{ Joules}$$