An X-ray detector includes a single-layered semiconductor substrate having an array of detection cells which directly convert photons of X-rays into electrical signals a first data collecting device which collects data with respect to the array of detection cells in a photon counting mode and a second data collecting device which collects data with respect to the array of detection cells in a current measuring mode.