An x-ray detector has a sensor (24) absorbing x-ray quanta of polychromatic spectra and generating an electric sensor signal corresponding to the absorbed x-ray quanta. There is at least one counting channel (430) including a plurality of discriminators (420) each counting a number of charge signals (450) detected at a different respective threshold since a beginning of a measurement interval and an integrating channel (440) which measures overall charge of the charge signals detected since the beginning of the measurement interval.