Your analysis is only partly correct; you've missed out on all the other business software they make tons of money on. MS is only highly profitable because of their business software, and the usage of their software in offices: Windows, Office, Sharepoint, Windows Server, SQL Server, etc etc. The place where they're failing abysmally is with consumers: they still sell (desktop) Windows of course, but they probably don't make much money with the home versions, and people aren't buying new PCs that much any more, and instead are buying smartphones and tablets (iOS and Android). MS's consumer offerings are ignored or laughed at: Surface, Windows Phone, etc. haven't done well. Xbox doesn't look like it's doing all that well any more either.
Basically, if MS cut out most of the consumer ventures, they'd be far more profitable. But there's definitely a tie-in there: people like to use software at work that they're familiar with, so if MS abandons the consumer space altogether, it wouldn't be long before companies shift to something else for their desktops, and then the rest of the MS infrastructure would crumble too.
So they are slowly becoming the IBM of the software industry?
So, when will they sell the consumer parts to a Chinese company?