Shares of Nvidia (NVDA 4.11%) and Datadog (DDOG 3.96%) have delivered some of the worst results of 2022 for investors, plummeting 48% and 59% year to date, respectively. And these companies are far from being microcaps. Datadog and Nvidia had market capitalizations of nearly $56 billion and $753 billion, respectively, at the start of the year, making their large drops even more noteworthy. 

Every business endures challenges from time to time, but great ones can overcome them and continue to win over the long haul. Here's why these two companies could push forward and become fruitful investments in 2023 and beyond.

1. Nvidia

Nvidia got crushed this year, and one cause for that was the weakness in one of its largest revenue segments: gaming. With inflation and higher interest rates tightening consumers' budgets and causing people to fear that a recession is looming, spending on personal computers (PCs) dropped notably. Considering that Nvidia is one of the top makers of the graphics processing units (GPUs) that gaming PCs rely on, that decline hit it hard. In its fiscal 2023 third quarter -- which ended Oct. 30 -- Nvidia's gaming revenue declined by 51% year over year to $1.6 billion. The gaming segment was its biggest revenue driver just three quarters ago.

It makes sense that Nvidia shares have gotten knocked because of this, but the future of the chipmaker isn't gaming -- it's all the other industries it caters to. Gaming is no longer Nvidia's largest segment. The data center market is, and that space continues to mature rapidly. In fiscal Q3, the company's data center segment revenue soared by 31% year over year to $3.8 billion.

And Nvidia has its fingers in other emerging business lines, providing chips for the automotive, artificial intelligence software, and omniverse software industries. In management's view, the combined prospects for these industries add up to a future addressable opportunity of $900 billion. 

Nvidia's stock got beat up because of the short-term declines in gaming, but it's clear that gaming's not where the future of the business lies. The company is making impressive progress in these emerging spaces and is already a leader in some of them. For example, 72% of the world's top 500 supercomputers are powered by Nvidia chips. Additionally, the semiconductor stock has in recent months been trading at its lowest valuations by price-to-sales ratio since March 2020. Based on these depressed valuations, investors might be undervaluing its most important business segments, which could allow Nvidia to surprise the market with great performances in 2023 and beyond.

2. Datadog

Plenty of onlookers were left scratching their heads at Datadog's weak stock performance this year -- its price was more than cut in half. On the one hand, software stocks broadly got clobbered due to falling demand, but that isn't the case for Datadog. Demand for the company's observability and performance monitoring tools is still extremely high, so even though many businesses are cutting back, they don't seem to be reducing their spending at Datadog. 

This was made clear by the company's third-quarter results -- all financial metrics pointed toward continued success. Revenue rocketed 61% higher year over year to $437 million. Additionally, customer churn remained in the low single-digit percentage range, and the company's net retention rate stayed above 130% for the 21st consecutive quarter. In other words, you might not guess that economic conditions are concerning if you only looked at Datadog's results this year. 

That's not to mention its cash generation, which also rocketed higher. Over the trailing 12 months, Datadog generated $364 million in free cash flow, representing a margin of 24%. Note that the company was only free-cash-flow breakeven just three years ago. That's a drastic improvement over a fairly short time. 

So if the company isn't struggling, why is its share price down so far? The likely explanation is that Datadog previously was trading at excessive premiums. At the start of this year, it was valued at a whopping 60 times sales. Now that high-growth companies have fallen out of favor, the market has reevaluated matters. Datadog trades at around 15 times sales nowadays, its lowest valuation since March 2020.

However, there's no indication that Datadog's jaw-dropping execution will sputter in 2023. With shares trading at their lowest valuation in years, investors might want to add a few shares to their portfolio before Datadog potentially rockets higher.