Dallas-based Energy Future Holdings is preparing for a bankruptcy filing after months of talks with creditors have failed to produce an agreement on restructuring nearly $40 billion in loans, according to a report in The Wall Street Journal.

Citing unnamed sources, the newspaper said that a last-minute deal is possible but that EFH is lining up debtor-in-possession loans to keep its operations running during bankruptcy proceedings. It said that lacking a prepackaged deal with its lenders, EFH could file a Chapter 11 bankruptcy petition in March or early April.

A bankruptcy filing has long been expected. The economics of the $45 billion leveraged buyout of the former TXU Energy by big investors in 2007 were torpedoed by the collapse in natural gas prices. The wholesale electricity market in deregulated Texas is largely driven by the price of natural gas, the fuel behind about 40 percent of the state’s power last year.

The company has said any bankruptcy filing would not affect its daily operations. Its Luminant Generation subsidiary is the state’s largest power producer, and its TXU Energy subsidiary is the state’s largest retail seller of electricity.

EFH also owns 80 percent of Oncor Electric Delivery, the regulated utility that owns the poles and wires distributing power to most of North Texas. But that operation was isolated from EFH’s finances under terms of the 2007 deal, and it remains profitable.

The deregulated entities have about $38 billion in outstanding debt.

The Journal reported that a bankruptcy filing would also mean splitting up Luminant and TXU Energy. The paper, citing two unnamed sources, said Citigroup, JPMorgan Chase, Bank of America and Morgan Stanley are considering extending loans to EFH.

In any event, the investors aren’t expected to see much of the $8.3 billion they put into the deal. KKR, TPG Capital and Goldman Sachs Capital Partners have already written off most of the value of that stake.