The only way to prevent white residue from hard water in a dishwasher entirely is to install a water softener in the household water system. However, several things can be done to help reduce or prevent the residue. Contact your local water company and ask about the mineral level in your local water. If the water has 13 grains or more, a water softener or detergent specifically designed for hot water might be necessary.
Citric acid dissolves residue from the interior of the dishwasher. Take any metal pieces out of the dishwasher. Fill the detergent cup with citric acid crystals instead of detergent and run a normal wash cycle. Once the citric acid wash is complete, run the dishwasher through a second cycle with regular detergent.
Remove any metal pieces from the dishwasher. Put a glass with 2 cups of white distilled vinegar in the bottom rack. Do not place detergent in the dispenser, but run a normal cycle. Either stop the dishwasher before the dry cycle or use an “Air Only” dry cycle. Repeat as needed until the white residue is gone.
For best results, set the household water heater between 120 and 140 degrees Fahrenheit. The water will be warm enough to effectively wash dishes, but not hot enough to generate more mineral content.