In recent years, investing in traditional retail has mostly been a losing proposition. Investing legend Warren Buffett summed up the current environment by saying, "The department store is online now." And it seems you can't turn around without reading about the "retail apocalypse." In 2017, 20 notable retailers have filed for bankruptcy protection as Amazon.com has turned retail square footage -- once considered a retailer's source of strength -- into a negative.

Still, retail's performance has been uneven. Nowhere is this more acute than big-box retailers: companies that operate chains of large superstores. While many big-box retailers are fighting to survive, quite a few are thriving in the current environment. Fortunately, bearish headlines have presented value-oriented investors with opportunities to find high-quality companies at a cheap valuation. Here are a few items you should know before investing in big-box retail using Wal-Mart (WMT 0.62%), Best Buy (BBY -0.08%), Target (TGT 1.60%), and Home Depot (HD 0.47%) for comparisons.

A couple shopping with their child.

Image source: Getty Images.

Mind your margins

Retail is a notoriously low-margin business. In fact, the reason big-box retailers came to dominate the retail landscape is that they were able to buy products in bulk, saving on costs, and undercut mom-and-pop retailers to steal customers. A great deal of the pressure retailers are currently under is due to the fact Amazon is able to work at such a large scale, and without the overhead of retail space.

So as an investor, monitoring a retailer's profit margin is a good place to start your analysis. Instead of net profit margin, which can include non-operational items, it's better to look at operating margin to get a sense of how the business is being run.

BBY Operating Margin (TTM) Chart

BBY Operating Margin (TTM) data by YCharts

There are three ways to improve operating profit margin: (1) charge more for products and risk market share, (2) pay suppliers less and risk inventory outages, or (3) spend less on operating items like salaries and administrative costs and risk creating an unmotivated and lower-skilled workforce.

Also note differences between retail type. Specialty retailers often have more leeway to charge higher prices due to lack of competition, while fast-moving consumer goods and grocery items must compete on price. As you can see from the chart above, Home Depot has the highest operating margin of the listed retailers.

Inventory turnover shows efficiency

In the highly competitive retail industry, it is imperative to monitor a company's operations to determine efficiency. One of the best ways to do so is to look at a retailer's cash conversion cycle: a measurement of how efficient a company is at turning inventory to cash flow. Essentially, it measures how long a dollar is tied up in business operations whether by inventory on the shelf or uncollected accounts receivable.

While most investors consider earnings the most important investing metric, a recent report from the CFA Institute's Financial Analyst Journal found cash flows are ultimately a better indicator of stock performance. The more efficiently a company can produce cash from inventory, the more likely the stock price will increase in the long run.

WMT Cash Conversion Cycle (Quarterly) Chart

WMT Cash Conversion Cycle (Quarterly) data by YCharts

The cash conversion cycle is measured in days, and it takes Home Depot 35 days to turn an inventory purchase into cash while it takes Wal-Mart only nine. Due to differences in inventory, it's often not great to compare a specialty retailer, that deals with seasonality, with an everyday retailer. Better comparisons are between two similar retailers and time-series comparisons to analyze if a company is getting more efficient. Additionally, specialty retailers often have higher profit margins, which allow the company to have lower turnover and still maintain strong cash flow.

Strategy is important

Investing is more art than science, so it's important not to solely rely on metrics to form an investing thesis. Investors should understand a retailer's recent history and its plans to grow sales, profit, and cash flow.

Recently, the fortunes of these big-box retailers are as varied as their products. Wal-Mart has rallied under CEO Doug McMillion after taking tough steps to reinvent its business in the last few years. Wal-Mart's purchase of Jet.com has allowed the company to better compete online and has led to strong performance. Target continues to underperform as CEO Brian Cornell is in the initial phases of a $7 billion plan to reinvigorate its business.

The recent run from Wal-Mart has the company now beating the S&P's return for the prior decade, while Target has only provided investors 2% price return in the last decade.

WMT Chart

WMT data by YCharts

Likewise, big-box specialty retailers Best Buy and Home Depot have seen their fortunes diverge. The electronics industry has been disrupted more by e-commerce than home improvement, as the former's products are easier to ship. Best Buy has responded aggressively to improve its online retail experience and has seen its stock increase 360% in five years. However, Best Buy's recent rally was mostly due to the fact the stock had been priced for a worst-case scenario as many were expecting it would follow Circuit City into bankruptcy; the stock has only returned 19% in the last decade.

Home Depot has cultivated a strong following of do-it-yourself renovators. However, Home Depot's stock price explosion can be partially attributed to its prodigious share buyback policy. Since 2008 the company has spent approximately $60 billion in share buybacks, lowering its outstanding shares by 36%. The lowered share count has allowed the company to increase its per-share price nearly 550%. During the last conference call management said the company would spend $8 billion in buybacks in fiscal year 2017.

The death of retail has been exaggerated

Ultimately, the death of retail has been greatly exaggerated, leading to a relatively cheap industry. However, it's important for investors to pay attention to the competitive, ever-shifting landscape. In the end, big-box retailers that are able to build upon their brand reputation via strong execution and consumer-friendly pricing should be able to not only survive, but increase their market share and stock prices.