It is always news when Berkshire Hathaway (BRK.A 1.18%) (BRK.B 1.30%) reports its latest investment moves in its quarterly 13F filing. Last week, investors got a look at what Chairman and CEO Warren Buffett and his team were up to in the second quarter with the release of the latest 13F -- and there was plenty to digest there.

But what does this mean for Berkshire Hathaway's stock price? Let's take a look at the most recent portfolio moves, as well as other factors, to determine whether Berkshire Hathaway is a buy.

The bear market takes a bite out of profits

Berkshire Hathaway is a holding company that runs a $300 billion investment portfolio of 47 stocks, as of the second quarter of 2022. It also wholly owns or has a majority stake in some 70 companies, including well-known brands like GEICO and Fruit of the Loom, as well as various energy, utilities, railroad, retail, financial, and industrial companies. Whether it's a stock or a business, Buffett and his team look to invest in companies that are good values -- meaning they are priced below intrinsic value based on their criteria. He also looks for companies with excellent management, strong competitive advantages, and good margins and financials, among other attributes. 

The strategy has been remarkably effective over the years. Berkshire's stock has gained 13% per year over the last 10 years, as of Aug. 22 -- outperforming the 11.4% annualized return of the S&P 500 over that same period. Even this year, with the S&P 500 down about 13%, Berkshire Hathaway has beaten the market, down about 2.6%.

BRK.B Chart

BRK.B data by YCharts.

In the second quarter, the company posted an eye-popping net loss of $44 billion, versus a $28 billion gain in Q2 2021. That was due primarily to a $53 billion decline in the investment portfolio after the bear market took hold. However, as management noted in its earnings report, it is important to look beyond the performance of the investment portfolio: "We believe that investment gains/losses, whether realized from sales or unrealized from changes in market prices, are often meaningless in terms of understanding our reported consolidated earnings or evaluating our periodic economic performance. We continue to believe the investment gains/losses recorded in earnings in any given period has little analytical or predictive value."

Better measures are its revenue and operating profit. Berkshire Hathawayʻs businesses generated $76.2 billion in revenue in the quarter, up from $69.1 billion a year ago. Expenses were $65 billion, up from $61.2 billion a year ago, so the company had an operating profit of about $11 billion in the quarter. 

Is it a buy?

The rocky second quarter proved to be a good buying opportunity for Buffett and Berkshire Hathaway. They bought some $6.2 billion in stocks and sold about $2.3 billion. What was Buffett buying? For starters, he piled more money into Berkshire Hathawayʻs largest holding, Apple, which is down about 5% this year. Buffett also added sizable stakes into two energy companies, Occidental Petroleum and Chevron, as well as financial specialists Ally Financial and Markel. Energy stocks have been among the best performers on the market, while the financials should benefit from rising interest rates.

But the company still has a massive $105 billion in cash and cash equivalents sitting on the sidelines. The truth is, Berkshire Hathaway is built to weather quarters like the one we have just gone through, with its massive pile of cash and its diversified portfolio of investments. The companies it owns are spread across different industries and the overall portfolio has shown that it can perform well in various market cycles. Its stock portfolio had one of its worst quarters in years, but the mostly value names it holds will likely bounce back as we exit the bear market.

The consensus estimate among analysts calls for a 23% return over the next 12 months. When you consider its track record, excellent management, sound financials, and relatively good value, Berkshire Hathaway encapsulates what Buffett himself looks for in an investment. And that makes it a good long-term buy.