If someone glanced at Warren Buffett-led Berkshire Hathaway's colossal $371 billion portfolio, they'd notice something almost immediately. And that is the simple fact that a single company makes up some 43% of the entire portfolio.

That stock is none other than Apple (AAPL -0.35%). The consumer tech juggernaut has been a fantastic investment for the Oracle of Omaha, soaring 564% in the past eight years and crushing the broader Nasdaq Composite index.

After this remarkable run, this "Magnificent Seven" constituent is pretty expensive. But is the stock still a buy?

Valuation always matters

As of this writing, shares of Apple are selling at a price-to-earnings (P/E) ratio of 27.4. That's much more expensive than its historical 10-year average P/E multiple of 21.1 -- and significantly higher than the roughly 10.6 P/E ratio that Berkshire paid when it first invested in the business.

Thanks to the dominant industry positions held by Magnificent Seven companies, investors might feel compelled to buy their stocks without hesitation, Apple included. But history has shown us that this is a mistake.

In the 1960s and 1970s, it was the "Nifty Fifty" stocks. At the turn of the century, there were dot-com businesses. The thinking was that it didn't matter what valuation was paid. The companies in question were poised to continue growing rapidly, and this would reward investors, justifying the high share prices.

However, this kind of thinking is flawed. At the end of the day, valuation always matters. All else being equal, it's better to buy stocks when expectations are lower and the market has somewhat soured on a business. This adds upside should the company outperform Wall Street forecasts.

On the other hand, high valuations imply that the rosy projections analysts have about the future are a sure thing with a certain outcome. And this introduces downside risk if the business reports disappointing results or if investors' enthusiasm wanes.

Apple's growth prospects

With the benefit of hindsight, paying under 11 times earnings for Apple in early 2016 looks like a no-brainer investment. Berkshire's portfolio managers identified a clear mispricing that the market was offering and took full advantage of it. In other words, the odds were stacked heavily in the conglomerate's favor, because investors were short-sighted and worried about waning iPhone demand.

Over the next eight years, Apple reported solid growth thanks to strong iPhone upgrades, new product introductions, and a burgeoning services division. Plus, it returned hundreds of billions of dollars in cash to shareholders via buybacks and dividends. Nowadays, the market fully appreciates this business and its quality.

From today's perspective, paying more than 27 times earnings would probably only make sense if investors had conviction that Apple could grow its earnings per share well in excess of 20% for the foreseeable future. It takes imagination to believe this, though. And even then, it's still expensive.

Apple saw its sales decline 2.8% in fiscal 2023 (ended Sept. 30). Wall Street analysts expect revenue to increase by only 1.3% in the current fiscal year. This subdued outlook doesn't justify paying the current valuation.

Unless the business has plans to launch a truly game-changing offering that could move the needle, there isn't too much to be optimistic about. It was reported that management abandoned plans to develop an autonomous vehicle, which could've been just that sort of thing.

Apple's current valuation doesn't reflect the company's limited growth opportunities today. I'd actually be surprised if shares outperformed the Nasdaq Composite over the next five years. As a result, it's a smart idea to pass on the stock unless there's a sizable pullback.