Palantir Technologies (PLTR -3.72%) has reached many major milestones this year. The company joined the prestigious S&P 500 index back in September, proving it's now one of the major players driving today's economy. And in the most recent quarter, this 20-year-old business generated its biggest profit ever following quarter after quarter of double-digit revenue growth. The stock price has reflected all of this and more, and today, Palantir is heading for a mind-blowing 340% annual gain. That makes it the best performing stock in the S&P 500 for the year.

Why such success? Palantir launched its Artificial Intelligence Platform (AIP) a year ago, and demand from governments and commercial customers has taken off. The company, through its technology, helps its customers aggregate all of their data and make better use of it -- and often the results are game-changing.

And the excitement may not be over for Palantir even in these final days of the year. Last week, the company was invited to join the Nasdaq 100, and it will officially enter the index on Dec. 23. Should you buy the stock before that big moment? Let's find out.

Two investors look at something on a tablet outside.

Image source: Getty Images.

Palantir's commercial customer growth

First, let's take a closer look at Palantir and its progress over the past few years. The company has been around for a long while, as mentioned, and primarily was associated with government contracts. But in recent times, the commercial customer has discovered the power of Palantir's platforms, and AIP has cemented this trend.

Customers from United Airlines to Wendy's are using AIP to gain in efficiency and make decisions that could save them millions of dollars. And in recent quarters, U.S. commercial customer revenue has climbed in the double digits -- it rose 54% in the most recent period. A look at where the company stood in terms of commercial customer count just four years ago and where it stands today is particularly impressive and illustrates the strength of demand. Then, Palantir had 14 U.S. commercial customers, and today, it's reached almost 300.

At the same time, government customers continue to represent significant growth too, maintaining double-digit levels. In the most recent quarter, U.S. government revenue climbed 40%. This shows that the traditional revenue source still is generating growth for Palantir even as the new growth driver -- the commercial customer -- is strengthening. That's an ideal situation.

On top of this, Palantir said that in the recent quarter more than 100 deals that closed were valued at more than $1 million -- so in many cases, customers are making a big investment in their work with the company.

It's no surprise that Palantir recently reported its biggest profit ever and that major indexes are inviting the software company to join. Now let's consider whether you should buy the stock prior to its entry in the Nasdaq 100 on Dec. 23.

Funds tracking the Nasdaq 100

One thing in particular could support share performance following its entry. Funds that track the performance of the Nasdaq 100 must replicate the index's composition, so those funds will be buyers of Palantir. Though this is positive, it's unlikely to send the stock skyrocketing.

At the same time, it's important to remember that you're more likely to win in investing if you buy and hold for the long term -- and if you do, short-term movements won't impact your returns by much. So, this means you don't absolutely have to rush out and buy Palantir before its Nasdaq 100 entrance.

Now this leads us to one more question: Is Palantir a buy? The one problem with Palantir today is valuation, as it trades for 200 times forward earnings estimates. This may look steep, but if we consider the company's earnings growth rate -- and we can do this by looking at its forward PEG ratio -- the story looks different. A company may be overvalued if its PEG ratio is greater than 1.0, but Palantir's is 0.6, so by this measure, Palantir still could be a solid buy for investors focused on growth.

All of this means that today, even after Palantir's enormous gains, it still makes a top artificial intelligence buy for investors -- to get in on before or after its debut in the Nasdaq 100.