A device (100) for carrying out at least one measurement and for removing milk samples from a milking machine, through which milk can flow. The device comprises an air separation device (101), a measurement device (102), a sampling device and a channel (202) that is open to the top. The air separation device is designed to separate the milk from air. The measurement device is arranged downstream of the air separation device. It is connected to the air separation device by a first milk outlet opening of the air separation device and designed to carry out one or more measurements with the milk flowing through the device. The sample removal device is designed to supply milk to a sample container (105). The channel open to the top is arranged upstream of the measurement device and is designed to receive at least a part of the milk which was separated from the air.