One of the most important lessons an investor can learn is that as painful as they may be, bear markets are historically the best time to get industry-leading stocks at unprecedented bargains. Why? A falling market tends to take down both winning companies and their weaker counterparts, throwing out the baby with the bathwater, as the old saying goes.

Perhaps one of the best examples of this phenomenon is Salesforce (CRM 4.31%). The software-as-a-service (SaaS) pioneer is the leading provider of customer relationship management (CRM) solutions but has experienced a stock price decline of 59%, despite a strong history of growth and its industry-leading position.

Can Salesforce overcome the current tempest that has rocked its stock in 2022? Let's step back and look at the big picture.

Person wearing a telephone headset while looking at a laptop.

Image source: Getty Images.

Near-term headwinds

It's certainly easy to understand why fair-weather investors have become cautious about Salesforce's future prospects. For the first nine months of fiscal 2023 (ended Oct. 31), revenue rose 20% year over year in constant currency, (stripping out the volatility of foreign-currency headwinds), down from 25% growth in fiscal 2022. 

Another area of scrutiny is the company's remaining performance obligation (RPO), a leading indicator of sales growth, which has edged lower in each of the three preceding quarters. This makes sense. As the economic uncertainty has persisted, businesses have sought to temporarily rein in spending to preserve precious cash reserves to ride out the downturn. 

However, focusing solely on the short term fails to acknowledge the secular tailwinds that will drive Salesforce stock higher for years to come.

Where will the growth come from?

While growth has certainly decelerated, it remains fairly robust, particularly considering the broader economic headwinds. A look at the segments that have fueled Salesforce's gains helps lay out its future growth potential.

In its fiscal 2023 third quarter (ended Oct. 31), the company's service and data segments each grew revenue by 16% year over year in constant currency. Revenue from its sales segment grew 17%, while the marketing and commerce segment grew 18%. Finally, its platform and other segment grew 22%.

It's also worth noting that each of these segments generated revenue of more than $1 billion, which shows that even in tough times, Salesforce can continue to grow at scale. 

Furthermore, Salesforce delivered impressive growth in each of its major international markets. In the Americas -- its most established market -- revenue grew 16% year over year, while Europe, the Middle East, and Africa (EMEA) grew 23% in constant currency. At the same time, Asia Pacific (APAC) grew by 30%, albeit from a smaller base. 

This all suggests that when foreign currency headwinds subside and the economy regains its footing, Salesforce is well positioned to resume its upward trajectory.

Digital transformation

One of the biggest trends over the past several years has been the digital transformation. In simplest terms, this is the process of employing technology to increase efficiency, improve the customer experience, and expand opportunities. Adopting cloud-based technologies is one of the most common examples of the digital transformation in action.

Salesforce provides a wide range of business systems that help accelerate a company's digital transformation. These include sales, service, marketing, e-commerce, and data analytics. Recent acquisitions -- including Tableau, Mulesoft, and Slack -- have expanded the company's ecosystem and grown its opportunities.

Management now expects the company's total addressable market (TAM) to increase to more than $290 billion by 2026, with contributions for each of Salesforce's major segments.  For its full 2022 fiscal year (ended. Jan. 31), Salesforce generated revenue of $26.5 billion, which helps illustrate the magnitude of the opportunity that remains.

There's more. The ongoing adoption of cloud-based systems is expected to increase demand for the services Salesforce provides for years to come. Worldwide, the digital transformation market reached $588 billion in 2021 and is expected to climb to $3.7 trillion by 2030 -- a compound annual growth rate (CAGR) of nearly 24% -- according to Polaris Market Research. 

CRM Chart

Data by YCharts

A worthwhile history lesson

Looking to the past can sometimes provide insight into the path to recovery for a stock that's beaten down during a bear market. During the financial crisis of 2008, Salesforce stock plunged 68% from its high. Over the coming year, however, the stock soared more than 180%, as investors realized that a falling stock price doesn't necessarily signify a business that's in trouble.

Finally, Salesforce is selling for a song. The stock is currently trading for just 4 times sales, its cheapest price-to-sales ratio in 14 years.

Given the company's persistent growth, massive market opportunity, and bargain-basement sales price, Salesforce is a stock investors should buy before it starts soaring.