The D.C. Court of Appeals ruled yesterday that the Potomac Electric Power Co. is not entitled to collect up to $20 million in additional revenue.

In a 7-to-2 decision, the appeals court upheld a 1975 ruling by the city's Public Service Commission that denied Pepco the full rate increase it requested a year earlier.

If Pepco had been allowed to collect the additional revenue, the Pepco customers in Washington would have had to pay an average of $120 each.

In a 23-page decision for the majority, Judge J. Walter Yeagley rejected Pepco's argument that the commission had refused to consider critical data about the utility's financial condition when it turned down the full rate increase.

In his opinion, Yeagley expressed the court's reluctance to interfere with rate-making decisions, a power that he said was clearly delegated to the commission by Congress.

The decision by the full court yesterday overturns a November 1977 ruling in which two of the appeals court judges said Pepco was owed the money. That decision suggested that the $20 million be recovered through a surcharge on the utility bills of the city's 160,000 Pepco customers.

A Pepco spokesman said yesterday that the decision by the full court was a "setback" in Pepco's efforts to recover the lost revenue. The utility could now ask the U.S. Supreme Court to review the appeals court decision, the spokesman said.

People's counsel Brian Lederer, a District government employer who represents the interests of city consumers, joined the commission in opposing Pepco's request. He said yesterday that the decision "saves the consumers $20 million and says loud and clear that the court of appeals respects the judgment of the Public Service commision."

The appeals court ruling yesterday included a stinging dissent by Judge Stanley S. Harris, who said the majority opinion "reflects an inadequate understanding of how rate cases are tried."

At one point in his dissent, Harris referred to the commission decision as "one of the most arbitrary actions in the history of American rate-making . . ." Harris was joined in his dissent by Judge Frank Q. Nebeker. Harris and Nebeker had granted Pepco the $20 million reimbursement in 1977, with Yeagley dissenting at that time.

The debate in the appeals court centered on Pepco's application to the commission in 1974 for a rate hike that would yield a $50.8 million increase inrevenues.

The commission granted Pepco a $27.6 million revenue increase, based on financial data detailing Pepco's financial condition in the "test year" of 1974. Pepco, however, protested that the commission had refused to consider other information that showed that 1974 was not representative of future years when new rates would be in effect.

In the majority decision yesterday, Yeagley said, "although (Pepco) is expected to base its application on a specified test year, when a dispute arises later as did here, it is up to the commission in the reasonable exercise of its discretion to determine to what extent the new data can and should be used."

Yeagley said the court found "there was no error in the commission's decision not to make a last-minute change in the test year."

"Pepco did not make clear for any reasonable person to understand at the time it filed the new data that it was taking a position that the (commission) must adopt a revised test year," Yeagley wrote.

"The commission in using a 1974 test year did weight and consideration to the 1975 date filed by Pepco," Yeagley said. "We would observe that filing the latest available operating data does not necessarily mandate a change in the test year by the commission.