Salesforce (CRM 0.42%) and Veeva Systems (VEEV 0.91%) represent two very different ways to invest in the cloud-based customer relationship management (CRM) market. Salesforce is the world's top cloud-based CRM service provider, while Veeva only provides CRM services for the life sciences market. But they share a lot of DNA: Salesforce's former senior VP of technology Peter Gassner founded Veeva in 2007, and Veeva plans to run its services on Salesforce until 2025.

Over the past 10 years, Salesforce's stock rallied more than 300% as Veeva's stock surged nearly 500%. Salesforce profited from the ongoing digital transformations of large businesses, and it repeatedly expanded its ecosystem with additional cloud-based sales, marketing, analytics, data visualization, and collaboration services. Veeva didn't face any meaningful competitors in its niche market, and intense competition between its life science clients fueled its long-term growth.

A group of young people hold up a cardboard cutout of a cloud.

Image source: Getty Images.

But this year, Salesforce's stock price rallied 65% as Veeva's stock only rose 36%. Let's see why the CRM leader outperformed the niche underdog -- and if it will remain the better overall investment for the foreseeable future.

Salesforce is prioritizing its profits over its sales growth

Salesforce's revenue rose 25% in fiscal 2022 and 18% in fiscal 2023 (which ended this January). But for fiscal 2024, it expects only 11% revenue growth.

That slowdown can be attributed to three challenges. First, the macro headwinds drove many large companies to rein in their spending on Salesforce's services. Second, Salesforce lapped several major acquisitions (including Tableau in fiscal 2020 and Slack in fiscal 2022), and it stopped making big purchases over the past year. Lastly, it still faces intense competition from Microsoft, Oracle, SAP, and Adobe across the slowing CRM market.

As Salesforce's growth cooled off, activist investors pressured it to boost its operating margins and profits. It complied with those demands by laying off about 10% of its workforce and cutting costs across the board. It expects those efforts to boost its adjusted operating margin to 30% in fiscal 2024 -- compared to 22.5% in fiscal 2023 and 18.7% in fiscal 2022. The company also launched its first buyback plan last year, and it's already repurchased $4.1 billion in shares in the first half of fiscal 2024.

Driven by that disciplined spending, Salesforce expects its adjusted earnings per share to grow 53% to 54% for the full year. That's an impressive growth rate for a stock that trades at 28 times forward earnings.

Veeva's cyclical downturn could end soon

Veeva's revenue rose 26% in fiscal 2022 and 16% in fiscal 2023 (which also ended this January), but it expects just 10% growth in fiscal 2024. That slowdown occurred as Veeva's larger clients downsized their sales teams, reined in their spending on new projects, and focused on larger R&D deals, which took longer to book as revenue. Its smaller biotech clients also struggled to raise fresh funds and start new projects. 

Veeva expects the macro environment to remain challenging this year, but it doesn't expect it to get significantly better or worse. Instead, it's maintaining a neutral outlook, isn't aggressively cutting costs like Salesforce, and expects its adjusted operating margin to land at 5% for the full year -- compared to 38.5% in fiscal 2023 and 41% in fiscal 2022. It only expects its adjusted EPS to grow 9% this year -- which seems underwhelming for a stock that trades at 49 times forward earnings.

Nevertheless, Veeva reiterated its longstanding forecast for generating at least $2.8 billion in revenue in fiscal 2025 -- which would represent an acceleration with 18% growth from fiscal 2024 -- as its adjusted operating margin bounces back to 36% in a more favorable macro environment. In short, Veeva's cyclical slowdown could end over the next few quarters -- and the bulls might return as they focus on the dominance of its niche market instead of the near-term headwinds.

The winner: Salesforce

Salesforce and Veeva are both still sound long-term investments. But if I had to choose one over the other right now, I'd stick with Salesforce, because it's generating stronger earnings growth and trading at a much lower valuation. Veeva's growth could accelerate over the next two years, but a lot of that growth has already been baked into its stock price.