The District of Columbia ended the 1978 fiscal year with a surplus of $40 million, the biggest year-end cash balance in at least 10 years, Mayor Walter E. Washington announced yesterday.

Instead of spending the money, the mayor proposed that it be used to set up a new revolving fund that would be used to pay the city's bills at times when its cash otherwise would run low. He said it would end costly short-term borrowing from the U.S. Treasury.

"As we look ahead, the financial future of the city looks bright," the out-going mayor said, with obvious pride that the city has not faced financial crises like those of New York and Cleveland.

"The city is fiscally sound and healthy," Washington continuted. "in the past two years in particular, we have seen a sharp upturn in the city's economy and significant changes in the fiscal picture."

The mayor said the city was able to pay off all short-term debt and accumulate the $40 million "because of increased revenues , smaller budget increases and prudent financial management."

Two years ago, assistant budget director William Krause said, the city was about $40 million in debt to the treasury.

Acting budget director Gladys W. Mack said the city expected to have a balance of only $3 million when the fiscal year ended Sept. 30.

Instead, costs were down by $10 million and tax collections were up by $27 million. She said real estate taxes were above original expectations by $7 million, sales taxes by $6 million and income taxes by $1o million.