Make sure this is a bug, and not a feature
When the vacuum is in the upright position, the agitator should not rotate. When the handle is lowered the agitator should be engaged, however, some models offer a manual agitator shut off feature. Make sure if your model has this feature, it is not turned on.
Check the hose
Next ensure that when you lower the handle, the attachment hose is not becoming dislodged. On some vacuums if the hose is removed, the lower portion of the vacuum disengages.
Check the belts
If one of the belts becomes worn or stretched, the agitator may spin fine until it comes under load. Once the agitator meets resistance, the belt slips, and the agitator stops spinning. Consult the user manual on how to check and replace belts in your particular model.
Image source: Pet Cyclonic Bagless Upright Owners Manual.