THE DISTRICT OF Columbia had managed to balance its budget for three consecutive years under the watch of the federal control board when Natwar M. Gandhi was named chief financial officer in 2000, but its fiscal health was still wobbly at best. Data were unreliable, systems were faulty and elected officials had to be restrained from a propensity to spend more than the city took in. Mr. Gandhi helped to change much of that, playing an instrumental role in the District’s fiscal turnaround that should not be forgotten or go unappreciated as he departs from office.

Mr. Gandhi announced Friday that he would leave office June 1. “The city is in good shape. It’s as good a time as any,” he told in what amounts to an understatement of the District’s robust finances at a time many state and local governments are struggling. Indeed, days before his announcement, Mr. Gandhi joined Mayor Vincent C. Gray (D) to report a $417 million budget surplus for fiscal year 2012 that — along with rising revenue and oversubscribed bond issues — helps make the District’s financial condition what Mr. Gandhi called “perhaps the best in its history.”

Mr. Gandhi’s decision to leave comes months after he was reappointed to a third term he had vigorously sought but that soon became shadowed by controversy. A series of Post articles focused on his office’s lowering of commercial property tax assessments and its shielding critical audits from public view. In addition, troubling issues still surround the handling of the city’s lottery contracts and the dismissal of former contracting officer Eric W. Payne, who complained about political pressure and other improprieties. Federal investigations into these matters are underway. The outcomes of these inquiries — such as the $50 million theft orchestrated by a mid-level tax-office employee — must be included in any assessment of Mr. Gandhi, but they cannot erase the accomplishments of his notable tenure.

Nor, more importantly, should they be allowed to diminish the importance of this office. The District is unique — and fortunate — to have a chief financial officer to make independent judgments about its finances and to help enforce sound practices. This role is even more critical with the D.C. government under a cloud of investigations by the U.S. Attorney’s Office. A spokesman for Mr. Gray promised a “thorough and thoughtful search” for Mr. Gandhi’s successor, who will be subject to approval by the D.C. Council, but no details were released. We would urge the mayor to conduct a national search that could identify the best candidates for what likely will be one of Mr. Gray’s most important decisions.