Microsoft (MSFT -0.82%) investors have done very well for themselves over the past few years. It doesn't hold the title of the world's largest company at the moment, but Microsoft retained that position for many months due to its strong success.

Although practically any time in the past has been a great time to buy Microsoft stock, I'm avoiding it right now due to one huge red flag, which I think it could be a dealbreaker for the stock.

Microsoft is excelling

To use a Microsoft Office pun, Microsoft excels as a business. All three business segments are doing great, with each one growing revenue at a strong pace.

The intelligent cloud segment led the way, with revenue growing by 21% to $26.7 billion. This division houses Azure, Microsoft's cloud computing business. Because many artificial intelligence (AI) models are run on Azure's infrastructure, it's benefiting tremendously from the AI arms race.

After multiple quarters of underperformance, the more personal computing segment (which includes its gaming and hardware divisions) grew revenue by 17%. This was heavily influenced by the Activision Blizzard acquisition, which is likely why it grew revenue in the quarter versus the more historical trend of shrinking sales.

Finally, Productivity and Business Processes, which includes all of its Office subscriptions, saw revenue grow by 12%. This was the weakest division, but 12% growth is still healthy.

In the third quarter of its fiscal year 2024, ended March 31, Microsoft knocked it out of the park. And it will likely do so again when it reports Q4 earnings on July 30. But, to own the stock, you have to pay a hefty premium, which is where my red flag comes from.

Microsoft's stock is too expensive compared to its peers

Because Microsoft's stock run-up has occurred at a quicker pace than its earnings growth, the stock has a premium valuation.

MSFT PE Ratio (Forward) Chart

MSFT PE Ratio (Forward) data by YCharts

At 33 times forward earnings, Microsoft stock isn't cheap. Compared to the S&P 500, which trades at 22.7 times forward earnings, investors have to pay up to be a Microsoft shareholder. Because the forward price-to-earnings (P/E) ratio uses analysts' estimates, it's not a perfect measure. A better use for this metric is to compare it to its historical average P/E ratio to determine what expectations are built into the stock.

Over the past five years, it traded for 32 times trailing earnings. This indicates that after a year's growth, Microsoft would return to its average valuation.

However, the past five years have been unique with low interest rates, so this estimation may be aggressive when determining a long-term P/E ratio. Suppose we lower the P/E ratio to 25 times earnings, a more historical average valuation for a company with best-in-class execution. In that case, Microsoft must grow its earnings by 54% to reach that figure.

That's not an insurmountable growth rate, but it does require sacrificing a couple of years of growth.

So, while Microsoft's business will likely continue doing well, I'm concerned that the stock has already pulled those gains forward. Instead of Microsoft, I'd consider other big tech stocks like Alphabet or Meta Platforms that already trade around that 25 times earnings mark. Additionally, these two are also growing at similar or faster speeds than Microsoft, meaning their business growth will more directly translate to stock price appreciation.

I think Microsoft is a great business, but the price investors have to pay is just too rich at the moment.