Department store titan Macy's (NYSE:M) is coming off a bad couple of years. Sales have been sliding since the beginning of 2015. Meanwhile, the company's cost cuts haven't been enough to keep Macy's profit margin steady. This has led to a series of sharp profit declines.

Macy's management doesn't expect much improvement in 2017. But the sales slowdown that has decimated department stores recently hasn't extended to all brick-and-mortar retailers. In fact, off-price giants TJX Companies (NYSE:TJX) and Ross Stores (NASDAQ:ROST) continue to post steady gains in sales and earnings.

Macy's falls into a big rut

Sales first started to decline at Macy's in early 2015. At the time, management blamed the weak results on external pressures like the strong dollar -- which led to lower spending by tourists from overseas -- and unfavorable weather.

The exterior of a Macy's store

Sales have been falling at Macy's since early 2015. Image source: Macy's.

It gradually became clear that this is only part of the story. Mall traffic has been falling at an alarming rate in recent years, as consumer shopping habits have changed. Thus, even with more favorable weather last quarter, most department store chains reported big sales declines.

During 2016, Macy's revenue fell 4.8% to $25.8 billion. Total sales are now 8.3% below the all-time high of $28.1 billion reached in 2014. Earnings per share fell at an even more alarming rate during that period. Adjusted EPS totaled $3.11 in fiscal 2016, down from $4.40 just two years earlier.

Macy's is closing dozens of stores in the coming weeks in an attempt to right the ship. Yet it still expects sales in the remaining stores to decline by 2% to 3% this year, while adjusted EPS will be flat or down modestly.

Customers are flocking to off-price stores

It's common for pundits to blame Macy's woes on e-commerce juggernaut Amazon.com. Yet at a recent conference, Macy's CFO Karen Hoguet told investors that the growth of TJX (owner of the T.J. Maxx, Marshalls, and HomeGoods chains) and Ross Stores (owner of Ross Dress for Less and dd's DISCOUNTS) is a bigger competitive threat.

Indeed, TJX and Ross Stores have shown in dramatic fashion that it's still possible to succeed as a brick-and-mortar retailer if you offer something that customers want. Off-price stores are popular because they are convenient, inexpensive, and offer a "treasure-hunt" experience with constantly changing merchandise selections.

As a result, while Macy's has struggled mightily since 2015, TJX achieved comp sales gains of 5% in each of the past two years. Ross Stores wasn't far behind, posting annual comp sales growth of 4% in each year.

The exterior of a Ross Dress for Less store

Ross Stores has been posting solid sales growth year after year. Image source: Ross Stores.

Both companies have also been adding stores at a rapid pace. Between comp sales increases and the addition of new stores, TJX's domestic revenue surged about 7.5% last year. Results were similar at Ross Stores (which only operates in the U.S.), with revenue up 7.8%.

Furthermore, TJX and Ross Stores see plenty of room left for further store growth. In fact, both companies plan to expand their store bases by at least 50% in the coming years.

Macy's needs to adapt

It's clear that the department store business model, as represented by Macy's, is inferior to the off-price model. Macy's management recognizes this, too. The company is working hard to adapt its approach so that it acts more like an off-price retailer.

First, Macy's has created its own line of off-price stores, known as Macy's Backstage. While there are a few stand-alone locations, most Macy's Backstage stores are being built inside of existing Macy's stores. Macy's Backstage has a completely separate buying organization from the rest of the company and carries some merchandise categories (like toys) that Macy's wouldn't sell otherwise.

Second, Macy's is reducing the time-to-market for its private label goods. Department stores have traditionally made inventory commitments six months or more in advance, making them slow to react to changing consumer trends.

By contrast, off-price retailers like TJX and Ross Stores often buy merchandise just a few weeks before it hits store shelves. This gives them the nimbleness to quickly alter their selection to emphasize items that are selling well. Macy's will never be able to match off-price retailers in this regard, but any reduction in merchandise lead times will help.

Third, Macy's is moving to more of a self-service model, particularly in its shoe departments. Customers aren't willing to pay extra to be assisted by a salesperson. In fact, thanks to the ubiquity of off-price retailers, many shoppers now prefer to sort through racks of shoes on their own rather than having to ask a salesperson to retrieve items from a stockroom.

The dominance of off-price retailers over department stores seems inevitable at this point. The best thing retailers like Macy's can do is try to act more like TJX and Ross Stores.

Adam Levine-Weinberg owns shares of Macy's and is long January 2018 $60 calls on The TJX Companies and short January 2018 $90 calls on The TJX Companies. The Motley Fool owns shares of and recommends Amazon. The Motley Fool has a disclosure policy.