An implantable medical device has an event detector that detects a predetermined cardiac event during a heart cycle of a subject. A reference time is assigned to this detected cardiac event. An onset detector detects the onset of ventricular filling of the heart during the heart cycle. The relative time of the detected filling onset is determined based on the assigned time reference. An increased risk of heart failure of the subject is automatically determined based on the determined relative time for the filling onset. Generally, a reduction in the relative time, as determined at different points in time, indicates an increased heart failure risk or the presence of a heart failure condition.