This is true because the water would have gravitational potential energy that is caused by the water being held back by the dam and the water wanting to flow down.
This can be converted into kinetic energy when given the chance to, such as having a turbine on the dam.