Cloudy glassware and dishware can be caused by several factors, and do not necessarily mean that your dishwasher is breaking. Lack of phosphates in dishwasher detergent and "hard" water in your home could be possible reasons for cloudy glassware.
The use of phosphates in dishwashing detergents was banned by several U.S. states in 2010 because phosphates degrade the ecosystem, according to Bekins. Hard water calcium deposits are another culprit for cloudy glassware. To get rid of these deposits, clean the dishwasher with a pint of vinegar at the start of the wash cycle. Don't rinse plates before washing, and use warm water.