Add filter to getMeasurements function