An x-ray detector for a medical imaging device includes an anti-scatter grid, a measuring layer including a regular arrangement of measuring cells, and an evaluation unit. The anti-scatter grid covers the measuring layer and is aligned toward a specific focal point. The evaluation unit is configured to determine a focal position of an x-ray source relative to the focal point based on a local intensity difference of x-rays striking the measuring layer.