What happened

Shares of Salesforce (CRM 1.15%) climbed 12.6% last month, according to S&P Global Market Intelligence. The stock steadily gained throughout the weeks leading up to its quarterly earnings report amid broader momentum for growth stocks.

The leader in enterprise cloud software closed out the month by exceeding Wall Street's forecasts for first-quarter sales and earnings.

So what

Investors' risk appetite swung in May thanks to surprisingly strong economic data. The release of April's employment report suggested that significantly more jobs were added than analysts expected, which is a bullish sign that the economy might avoid the recession that many people have feared for months.

A few days later, inflation measurements indicated that monthly consumer price increases were below the consensus forecast, indicating that the Fed's rate hikes are slowly having the intended effect. This fueled speculation that monetary policy could soften before a major recession was triggered.

This was a major catalyst for growth stocks and many tech stocks. High interest rates combined with recession fears and slowing growth to create a highly risk-averse environment since the start of 2022. That's been a disaster for stocks with high growth rates and expensive valuations, and Salesforce is in that group.

People in suits sitting at a table, high fiving over laptop computes.

Image source: Getty Images.

Now, investors are seeing a light at the end of the tunnel. Recent economic indicators suggest that we could avoid a worst-case scenario, and the recent earnings season corroborated that optimism.

Nearly 80% of the S&P 500 exceeded earnings estimates in the first quarter, and the magnitude of that outperformance is above the historical average. Many of the strongest performers came from the tech sector, suggesting that Wall Street fears were slightly overblown.

These factors pushed Salesforce stock higher ahead of its own earnings report on the last day of May. The leader in customer relationship management (CRM) beat analyst forecasts for revenue and earnings, reaffirmed its full-year sales forecast, and increased its profit margin guidance.

Despite delivering a solid quarter, the stock slumped after its earnings report. Investors were looking for increased revenue guidance, so the reaffirmation was poorly received.

Now what

Salesforce's forward price-to-earnings ratio is nearly 28, even after its post-earnings slide. That's a substantial valuation increase after it was around 22 earlier this year.

It's fairly high for a company that is growing roughly 10% this year. However, there is hope that Salesforce can deliver top-line acceleration when macroeconomic conditions improve. It's also delivering expanding profit margins, so the company is primed to become a cash-flow monster over the next few years.

There's still a compelling long-term investment narrative here, but investors should be prepared for volatility thanks to that valuation.