This may be because the cable itself has been damaged or frayed. Inspect the cable for any signs of wear.
Also try connecting the charging cable and speaker to a different outlet to ensure that it is either the speaker or the cable that are the problem.
Also check the cable port on the speaker for any dirt or lint that may be trapped inside and preventing power from reaching the speaker.
The port can be cleaned with a compressed air duster if this is the problem.
If all else fails, the charging port itself may be damaged and need replacement.
For more information, see the Troubleshooting Guide.