Detergent residue is often the result of detergent not being properly dissolved before the wash. In other cases, placing washing on the surface of a full machine before adding detergent can cause air pockets to form under the washload. The undissolved detergent that remains in the air pockets is not dispersed by water agitating in the wash load. Undissolved detergent is then distributed through the wash load.
Lumps of powdered detergent are more difficult to dissolve. To prevent lumpiness, store your powdered detergents in a dry area to avoid moisture build-up. If you have a top loader, add detergent to the wash water and run your machine for a few minutes before immersing the article in the water. This will help ensure the detergent powder is properly dissolved. An alternative is to pre-mix the detergent with water or use Cold Power liquid.