Dishwasher detergent is sensitive to moisture and other environmental factors. If the detergent cup still has some soap left, scoop it out as much as you can and refill it with fresh detergent every time you add a new load, so that you get squeaky clean dishes every single time.