Microsoft (MSFT 1.02%) captivated Wall Street for several quarters now, with its stock up 41% over the last 12 months. While some of its peers  suffered from macroeconomic headwinds, the Windows company reported solid growth and continued to beat analysts' expectations. Meanwhile, Microsoft rallied investors with an expanding position in artificial intelligence (AI).

In fact, Microsoft overtook Apple as the world's most valuable company, with a market cap of $3 trillion.

Potent brands like Windows, Office, Xbox, LinkedIn, and Azure made Microsoft a tech behemoth. Its stock climbed 219% in the last five years alone, likely creating many millionaires along the way. However, the company could potentially beat that growth over the next half-decade as AI bolsters its cloud division, productivity software business, and even its personal computing segment.

So, here's why Microsoft could help you become a millionaire if you're willing to wait.

Smashing Q2 2024 earnings

Shares in Microsoft jumped 5% in after-hours trading on April 25 after the company reported its earnings for the fiscal second quarter of 2024, which ended March 31.

The company beat Wall Street expectations on multiple counts. Revenue rose 18% year over year to over $62 billion on expectations of just under $61 billion. Meanwhile, earnings per share reached $2.94 against forecasts of $2.82.

Microsoft benefited from impressive growth in multiple segments. The tech giant's productivity division reported a 13% year-over-year increase in revenue, while Intelligent Cloud sales climbed 20%.

Additionally, Microsoft's more personal computing segment posted a revenue boost of 19%, a promising sign that the industry is back on track after poor market conditions last year. The business includes income from the company's Xbox brand, which saw a 49% rise in gaming revenue. Microsoft attributed much of the growth to its recent acquisition of Activision Blizzard, the developer behind Call of Duty and World of Warcraft.

The glowing quarterly results could be an exciting glimpse into Microsoft's future, with growth catalysts across the tech industry.

Microsoft is gradually becoming a major threat in the AI market

Microsoft has a solid outlook, with leading positions in productivity software, computer operating systems, video games, and even social media. However, the company's biggest growth driver over the next decade will likely be AI and its cloud platform, Azure.

Microsoft's Intelligent Cloud segment produced nearly $27 billion in its most recent quarter. Seven percentage points of that growth were related to AI, up from 6 points the previous quarter. The company has a close partnership with ChatGPT developer OpenAI, granting it exclusive access to some of the most advanced AI models.

The software giant used OpenAI's technology to bring AI features across its product lineup, including new generative tools in its Office productivity suite and new AI cloud services on Azure. OpenAI's models, combined with Microsoft's vast user base in the business world, appear to be paying off. Companies are increasingly adopting Azure's AI features to integrate the technology into their businesses, boosting Microsoft's earnings.

Microsoft CEO Satya Nadella said in a statement, "Microsoft Copilot and Copilot stack are orchestrating a new era of AI transformation, driving better business outcomes across every role and industry."

The company's success has seen it steadily chip away at Amazon Web Services' (AWS) cloud market share. In the calendar fourth quarter of 2023, AWS' share fell by 2 points, while Azure's rose by 2 points.

Microsoft could be on a path to domination in AI software, and you won't want to miss out on its potential.

Worth its premium price tag

AMZN PE Ratio (Forward) Chart

Data by YCharts

Microsoft's forward price-to-earnings (P/E) ratio is higher than many of its peers. The company's stock is trading at roughly 36 times its earnings, meaning its shares aren't exactly trading at a bargain.

Forward P/E is a helpful valuation metric calculated by dividing a company's current share price by its estimated earnings per share. The lower the figure, the better the value. In this case, Microsoft is a better value than its biggest rival, Amazon. Yet, it is less of a bargain than Apple, Alphabet, or Meta Platforms.

However, I'd argue that Microsoft is worth its premium price tag and potentially a better buy than any of these companies. Microsoft is a better value than the top cloud provider, Amazon, while gradually gaining on its cloud market share.

Additionally, the Windows company hit over $67 billion in free cash flow last year, indicating it has the funds to continue expanding its business and keep outperforming its rivals.

Microsoft likely has a bright future as it continues to expand its role in AI and the cloud market. Meanwhile, its Xbox gaming division is enjoying swift growth thanks to its recent acquisition. The company has the potential to make you a millionaire with the right investment -- and as part of a diversified and well-balanced portfolio, of course. Microsoft stock is a no-brainer pick right now.