I always had trouble with onion powder (and other powders) caking soon after the container was opened. To measure an amount, I would have to gouge out a lump and rub it through a sieve.
Not any more. I save those little desiccant containers that come in many over the counter medicines. I place one in a newly purchased bottle of onion powder (or a bottle of powder I have salvaged by rubbing through a sieve). Voilà! Months later, the powder hasn't caked and dispenses freely.