Tech investors have had a good year so far, but the 22% surge in the Nasdaq Composite index still pales in comparison to the returns that Microsoft (MSFT 1.65%) owners have seen. The software giant is up over 30% through mid-May, in fact.

Wall Street is excited about the prospects for its cloud services division and the potential for a generally strong selling environment ahead for enterprise software. Looking further out, Microsoft might see excellent returns from attractive niches like video games, cybersecurity, and artificial intelligence (AI).

But does the over $2 trillion valuation on the business mean that expectations are too high for investors to see decent returns from here? Let's take a closer look.

More diverse than Apple

Microsoft and Apple (AAPL 0.64%) both have valuations over $2 trillion, yet Microsoft delivers more diversification than the iPhone maker does. Owning this stock means an investor is exposed to several growing tech segments like cybersecurity, subscription gaming services, and cloud enterprise software. That range of growth prospects is possible to achieve without owning Microsoft stock, but would require an investor to buy several other niche players.

The company's latest results show the strength of having this deep portfolio. While parts of the business, like games and PC hardware, shrank in early 2023, Microsoft's global revenue still rose 10%. Apple's sales ticked lower by about 3%, by comparison.

Profits and cash flow

The financial risk for Microsoft investors is also relatively low. The tech stock maintains some of the highest profitability on the market, with operating profit margin now sitting above 40% of sales. Microsoft generated $59 billion of operating cash flow over the past nine months, down only slightly from the prior-year period.

MSFT Operating Margin (TTM) Chart

MSFT Operating Margin (TTM) data by YCharts

Its ample cash generation has allowed executives to build up a large savings even as they invest in growth initiatives like AI and the Activision Blizzard acquisition. There's always the risk that big moves like this will destroy shareholder value. But Microsoft's track record has been generally positive on this score.

Paying up

That means the biggest risk for prospective investors is paying too high of a price for this profitable business. That's not a hard case to make given that Microsoft shares are valued at over 11 times annual sales compared to the pandemic high of about 13. Apple can be bought for 7 times revenue, by comparison. There are some rational reasons to believe that this premium valuation can drop over the next few years, including a downturn in IT spending or disappointing returns from AI investments and the Activision purchase.

On the other hand, Microsoft can also grow into that valuation by continuing to expand sales at a double-digit rate while maintaining its market-thumping profitability. And, either way, shareholders are likely to see strong returns, including direct cash returns from stock buyback spending and dividends. While Microsoft isn't going to double its market capitalization anytime soon, investors can still generate market-beating returns by holding the stock as part of a diverse growth-focused portfolio.