Microsoft (MSFT 1.78%) has been on fire so far in 2023, driven higher by a resurgence in technology stocks amid a broader market rally. Shares of the software and cloud technology specialist have gained 34% so far this year, more than double the gains of the S&P 500, which is up 17%. This is a welcome change compared to last year, when Microsoft stock slumped more than 28%.

The rally in 2023 has been fueled by the company's improving financial performance. Another driver has been Microsoft's significant investments in generative artificial intelligence (AI), which appear poised to pay off handsomely. These factors have increased investor confidence that the headwinds that marked much of last year are abating, allowing the company to capitalize on the coming AI revolution.

What does this mean for investors who missed out on Microsoft's current rally? Should they buy now in anticipation of further gains or avoid the stock because of the quick run-up and the persistent slump in the personal computer (PC) market? Let's see what the evidence suggests.

Person reviewing charts and graphs on multiple monitors and computer and printouts.

Image source: Getty Images.

What caused last year's stock slump?

Even the most resilient companies were impacted by the downturn, and Microsoft was no different. Particularly vexing was the veritable collapse of the PC market, which fell 16% last year, its worst showing in decades. Historically, about one-third of Microsoft's revenue comes from its More Personal Computing segment. For fiscal 2023 (ended June 30), revenue for the segment declined 9%, weighing on the company's overall returns. For context, revenue from the productivity and business processes segment grew 9%, while sales from the intelligent cloud segment jumped by 17%. 

The PC market has yet to recover, with shipments down 24% during the first half of the year, but the bottom may finally be in. PC shipments are expected to return to growth -- perhaps as soon as the current quarter -- notching 6% growth in the fourth quarter, according to market analysis firm Canalys. 

Once the PC market rebounds, this will remove a significant headwind from Microsoft's financial results.

What could drive Microsoft stock higher?

Challenges in the PC market aside, there are other factors that could contribute to Microsoft's ongoing stock rally.

The biggest potential opportunity is the rollout of generative AI tools embedded into the company's flagship products. First out of the gate is Microsoft 365 Copilot, which will be integrated with each business customer's individual data. Microsoft provided examples of how this new AI system can increase productivity:

So, Copilot can generate an update from the morning's meetings, emails, and chats to send to the team; get you up to speed on project developments from the last week; or create a SWOT analysis from internal files and data from the web. 

Microsoft plans to charge subscribers $30 per user per month, on average. CEO Daniel Loeb of hedge fund Third Point estimates that Copilot "could increase its revenues by as much as $25 billion or more on software sales alone." That's a pretty sizable chunk of change, considering Microsoft generated revenue of $56 billion in its fiscal 2023 fourth quarter.

Let's not forget Azure, the world's second-largest cloud infrastructure service. Microsoft has already embedded ChatGPT into its Bing search engine and has the resources to launch a full-scale generative AI program available to Azure customers -- for a fee. Just this week, Microsoft announced the availability of its Azure OpenAI service, its AI-as-a-Service offering.

This is the most recent volley aimed at establishing a foothold in the lucrative AI market -- and the AI revolution is just getting started.

How to approach Microsoft stock now

Microsoft is currently selling for 26 times trailing earnings, which compares favorably with the current price-to-earnings (P/E) ratio of 26 for the S&P 500.  That's a pretty reasonable price for a company that's expected to increase its revenue and earnings per share by double digits between now and 2024. 

As I've laid out above, Microsoft has numerous catalysts that could drive robust growth over the coming months and years. Microsoft has a long and successful history of reinventing itself, and the dawn of the AI age helps to illustrate that point.

The trajectory of AI will likely come in fits and starts, but Microsoft has numerous top-tier businesses that will form the foundation upon which its future success will be built. Shrewd investors will get on board before the real run-up in the stock price begins.