Berkshire Hathaway (NYSE: BRK.A) (BRK.B -0.69%) stock just went on a historic run.

Over the past 12 months, the stock price has surged by 25%. Over the past five years, meanwhile, shares have more than doubled in value.

Berkshire's stock price rarely rises this quickly over such a short amount of time. Is the stock still a buy? The answer might surprise you.

The most important number to watch

Berkshire is a behemoth stock. After the recent surge, the company now has a market cap of nearly $900 billion.

A chunk of that value is represented by Berkshire's insurance companies, which generate billions of dollars in investible cash. The vast majority of the company's value, however, is produced through its portfolio of business investments, which includes hundreds of positions across dozens of industries and geographies.

For example, Berkshire is the sole owner of Burlington Northern Santa Fe, one of the largest railroad businesses in North America. It fully owns many other well-known businesses including Lubrizol, a special chemicals company, See's Candies, a chocolatier, and Duracell, the battery maker. Berkshire also has a broad investment portfolio of publicly traded securities. Some its more notable positions include Amazon, American Express, Coca-Cola, and Apple.

When approaching a diverse and complex business like this, perhaps the most important number to pay attention to is its price-to-book ratio.

While there are some notable flaws behind book value, this accounting metric can be used to roughly approximate the value of a company's assets. A price-to-book ratio, therefore, gives you a sense of how much the market is willing to pay for a company's asset base. Over the past decade, Berkshire's price-to-book ratio has ranged between 1.0 and 1.6.

That 1.0 times book valuation occurred during the pandemic bear market. In hindsight, it was a great buying opportunity.

The 1.6 times book valuation, meanwhile, occurred only weeks ago. It was the stock's highest valuation multiple since 2008. Shares have pulled back a touch since then, but make no mistake: Berkshire stock is expensive compared to its past.

BRK.B Chart

BRK.B data by YCharts

Berkshire stock is still a long-term buy for this reason

There's no doubt that right now isn't the best time in history to buy Berkshire stock. But as we'll see, that doesn't mean shares aren't a buy.

Over the last decade, Berkshire's price-to-book ratio has risen by roughly 15%. That increase in valuation multiple accounts for part of the stock's positive performance, but only a small part.

Over the same period, Berkshire's stock price has risen by around 230%. That means the bulk of the stock's performance wasn't an increase in the price-to book ratio, but an increase in the underlying metric: book value.

In 2015, Berkshire's book value was roughly $250 billion. Today, it is around $560 billion.

So yes, the stock's price-to-book ratio has increased, but the stock's performance is no mirage. Berkshire shares have largely risen on improving fundamentals.

BRK.B Chart

BRK.B data by YCharts

Historically, there has never been a bad time to buy Berkshire stock. If you bought shares at the height of the dot-com bubble, you'd be sitting on a 1,000% gain. Happen to buy the stock right before the 2008 financial crash? No problem. Today, your investment would be worth nearly four times its original value.

To be sure, Berkshire stock may someday become overvalued, but not at a measly 1.5 times book value. Buffett and his investment team have consistently figured out ways to grow shareholder value over the long term, and short-term swings in valuation have never hindered the stock's long-term investment thesis.

Of course, we all wish we bought Berkshire stock before the recent run. But now is still a wonderful time to take a position in one of the market's longtime winners. Just be sure to hold through the volatility if the valuation multiple normalizes.