Greetings,
Welcome to the forum.
I am not a HP employee.
Are you in warranty? Your PC was released for sale by HP in June, 2018.
Contact HP (Link) if you are in warranty. It may not be too late to extend your warranty.
Connect the PC to a different AC power source to eliminate this as a cause.
Possible causes:
-Power supply
-Bad internal component or peripheral connected to the PC.
-Short
-Motherboard
Regards