He almost got into the 27 club - with Janis Joplin, Jimi Hendrix, Jim Morrison and others
As far as I get it he wasn't at a happy place in his life, trying for the last few years to stop being AVICII and become Tim Bergling once again - getting too famous too fast is an extremely strong drug. It can kill you. And severe pancreatitis on top of that...