Unstoppable. That's the word that comes to mind in describing how Palantir Technologies (PLTR 1.22%) stock performed in recent years. Since 2023, the stock has generated incredible returns of more than 2,100%. During that time frame, a $5,000 investment into the data analytics company would have grown to more than $110,000.

Palantir has done well in growing its operations. Its artificial intelligence (AI) platform is a big hit with customers, helping them improve efficiency in their day-to-day operations and save time and money along the way. The AI stock also benefited from a lot of hype and excitement from retail investors.

Shares of Palantir have hit new highs this week and are up around 85% year to date. But can there still be room for even more gains?

People reviewing a chart.

Image source: Getty Images.

Why the excitement could continue

Palantir has a diverse business, generating strong growth from both its government and commercial operations. And it's the former that may potentially get a boost in the future. Rising geopolitical issues and greater defense spending could lead to Palantir securing more government contracts, domestically and abroad. President Donald Trump has been a big proponent of investing in defense, and has often pushed for greater defense spending from America's allies.

During the first three months of the year, Palantir's revenue rose by 55% year over year, totaling $628 million. And its U.S. commercial revenue rose by 71%, which was a far quicker rate than its U.S. government business, where the growth rate was 45%. While that's still an impressive figure, an acceleration of it may lead to even more excitement around the stock.

Palantir has been a trusted name with not only the U.S. government but many government agencies around the world, aiding in counterterrorism efforts and intelligence. An uptick in its overall growth rate may also lead to a round of upgrades from analysts.

What analyst price targets say about the stock today

The consensus analyst price target for Palantir has been rising over the past year. As of June 16, it was $86.30, up from just $20.65 a year earlier. It's symbolic of just how much excitement has built up around the business in a short period.

That bad news is that with a consensus price target of just over $86, that suggests a lot of downside risk for investors who buy the stock today. But the good news is that price targets routinely change over time and investors should remember it is a moving number, based on projections. The last three analysts to set price targets for Palantir have set them above $100, with one as high as $155. If the company continues to perform well, then more upgrades may follow.

Is now a good time to buy Palantir stock?

Palantir trades at more than 600 times its trailing earnings. While it has grown its top and bottom lines, its valuation unfortunately doesn't line up with its financial performance. That can make it both an exciting and risky stock to add to your portfolio.

It's exciting because strong results, the government announcing an increase in defense spending, and favorable news related to contracts could conceivably give the stock a boost, regardless of where its earnings or revenue multiples are. But it's risky because the danger is that at some point the bubble could burst, especially if there are concerns about the economy; in early April when reciprocal tariffs were announced, Palantir's stock fell below $80.

I wouldn't rule out a higher price for Palantir simply because it can be so unpredictable and unstoppable. But because of that unpredictability, I'd also steer clear of the stock, simply because the downside risk is so significant.