The challenges of 2022's bear market are beginning to fade as Wall Street looks to the future -- and with good reason. The S&P 500 has already climbed 27% from its bear market low and sits just 5% below a new all-time high. Once the index exceeds that benchmark, it will mark the final measure signaling the arrival of the next bull market, putting any lingering doubts to rest.

Furthermore, there's a compelling argument that artificial intelligence (AI) is at least partially responsible for this year's market turnaround. As a result, investors are leaving no stone unturned to find the stocks best positioned to profit from the advent of AI. One such incredible stock is Microsoft (MSFT -0.60%). Despite notching 55% gains so far this year, there's evidence that suggests the company's best days are yet to come.

A hologram with various AI icons in a display above a laptop while a person types.

Image source: Getty Images.

The elephant in the room

Before we talk about the massive opportunity represented by AI, it's important to address the elephant in the room -- Microsoft's struggling personal computer segment -- which has historically generated nearly one-third of the company's revenue.

Macroeconomic headwinds convinced many users to hang on to their existing computers just a bit longer, particularly in the face of high inflation. This reduced buying power and weighed on consumer spending. In fact, in 2022, PC shipments plunged to their lowest level since 2008, according to market intelligence provider IDC. But green sprouts of growth are finally beginning to appear.

PC shipments are finally expected to return to growth, increasing 4% year over year in 2024, according to IDC. Furthermore, IDC believes the commercial PC market is on the verge of a refresh cycle, spurred on by the introduction of stronger processors, the coming end of support for Windows 10, and the growing adoption of generative AI.

During the first quarter of Microsoft's fiscal 2024 (ended Sept. 30), revenue for the more personal computing segment grew to $13.7 billion, up 3% year over year, marking its first quarter of growth in more than a year. This suggests that the long-awaited recovery of the PC market has finally begun, eliminating a headwind from Microsoft's results, which could ultimately push the stock even higher.

AI tools are Microsoft's next big growth opportunity

Microsoft helped kick off the mad dash to adopt AI with its $13 billion investment in ChatGPT creator OpenAI. Yet that was just the beginning of several strategic moves that helped Microsoft move to the forefront of this growing movement. The company quickly infused AI capabilities across a broad cross-section of its most popular products and services, and we're only just beginning to see the results.

The poster child for these efforts is Microsoft Copilot, an AI-fueled assistant designed to increase productivity when using almost any of the company's software-as-a-service (SaaS) offerings. CEO Satya Nadella revealed that "40% of the Fortune 100 are using Copilot as part of our early access program."

These AI tools could represent Microsoft's next big growth driver. Dan Loeb of hedge fund Third Point believes that AI could increase Microsoft's revenue by "$25 billion or more in software sales alone." Evercore ISI analyst Kirk Materne is even more bullish, suggesting Microsoft's AI offerings could result in $100 billion in incremental revenue by 2027.

CFO Amy Hood added fuel to the fire when she said, "The next-generation AI business will be the fastest-growing $10 billion business in our history." It's still early days for an opportunity that could take years to play out, but it's clear that Microsoft is currently a serious contender when it comes to AI.

It's official: Azure is stealing cloud share

Microsoft Azure has long been second banana to Amazon Web Services (AWS) as the No. 2 cloud infrastructure provider. Still, if recent developments are any indication, there may soon be a changing of the guard.

When Microsoft reported its first quarter results last month, one of the most significant developments was that Azure stole cloud share from both its cloud rivals, which was evident with a cursory review of the results. Azure's Cloud revenue grew 29% year over year, outpacing AWS and Alphabet's Google Cloud, which grew 12% and 22%, respectively.

If this trend continues, Azure could soon unseat AWS for the top spot. In the second quarter, Azure captured 26% of the cloud infrastructure market, trailing AWS with 30%, according to research firm Canalys. While the third-quarter market share numbers haven't been finalized, what we do know suggests Microsoft continues to close the gap with industry leader Amazon.

Perhaps as telling was a single line from Microsoft's earnings conference call, when Nadella noted that included in Azure's 29% year-over-year growth was "roughly 3 points from AI services." This shows that Microsoft is already capitalizing on the AI opportunity to grow its cloud presence -- and there's likely to be more to come.

Hand over fist

This all combines to show that Microsoft investors are still getting plenty of bang for their buck, even after the stock's impressive run so far this year. The company offers consistent growth from its SaaS business, the expected recovery of its more personal computing segment, and the ongoing growth in its cloud computing business -- bolstered by strong demand for AI services.

Despite all the irons the company has in the fire, Microsoft stock is still reasonably priced, selling for 33 times forward earnings and 10 times next year's sales. While that's a slight premium to the valuation the overall market is fetching, I would submit it's a bargain when viewed in light of Microsoft's increasing growth prospects.

This has all been a long way of saying I believe investors should buy Microsoft stock hand over fist and hold it forever.