dishes not getting clean

my Kitchenaid dishwasher has been noisy and fills swith water slowly, the water seems to come thru the arms slowly and then there really is no agitaton sound of the water. The dishes don’t really get clean especially the dishes on the top rack. It was an intermittent kind of thing before, but now it is everytime.Could it be the inlet valve and if so , how difficult is that to change? Thanks