Consider an ideal (rectangular profile in frequency domain) low-pass filter (LPF) which simply sets to zero all the frequencies beyond a certain cut-off frequency. Let $x$ be a discrete-time signal of duration $N$ in time domain, i.e., $x=[x_1,x_2,\ldots,x_N]$. Apply $x$ as input to the LPF and let $y=[y_1,y_2,\ldots,y_N]$ be the corresponding output signal in time domain. I have checked the spectrum of input and output signals and I can confirm the filter works well and also the input and output signals make sense.
From simulations, I can see that the following condition holds: $$ \sum_{t=1}^{N} x_t = \sum_{t=1}^{N} y_t. $$ My question is why this condition should hold. Is it there a general rule? I can think of an example where it holds. If I filter every frequency except the DC component, then the output signal in time is the mean value of the input signal and indeed the condition above is verified since $$ \frac{\sum_{t=1}^{N}x_t}{N}=\bar{x}, $$ where $\bar{x}$ denotes the mean value of signal $x$. If $y_t=\bar{x}$, $\forall t$, then $$ \sum_{t=1}^{N}y_t = \sum_{t=1}^{N}\bar{x} = N \bar{x} = \sum_{t=1}^{N}x_t. $$
For example, I know that by Parseval's Theorem the energy of the output signal will be different from the energy of the input signal (and this occurs) but I am not sure why the condition above should hold. Thank you very much in advance.