Sounds like it isn't charging when awake, but is when asleep or off? If that is the case, it could be that the settings (in "Control Panel" "Power Options") is set to stop charging when open. It happens. Settings get changed.
If you check all the power settings and it still does this, then I would start to think the charger is the problem. When they are going, they don't put out enough power to both run the device and charge it. If that is the case, you would need to replace the charger.