Joseph B. Danzansky, a leading member of Washington's business establishment and a notably effective supporter of consumerism, civil rights and related causes in the city, died at his home here yesterday following an apparent heart attack. He was 65.

Although he had been hospitalized earlier this year for treatment of cancer, Mr. Danzansky remained active until the end of his life. He presided yesterday morning at a meeting of the Pennsylvania Avenue Development Corp., of which he was chairman, and later had lunch at a popular downtown restrauant.

Mr. Danzansky was a successful lawyer in Washington. One of his principal clients was Giant Food Inc., and he was elected to Giant's board in 1949. In 1964, he gave up his law practice to become president of Giant, which was all but immobilized at that time by disputes in the family that owned it. He remained president until 1977 and then served as chairman of the board. In 1978, he resigned to become chairman of the board of the National Bank of Washington, the third largest in the city.

While pursuing his career in business, Mr. Danzansky was coming to the fore as a civic leader and there were few aspects of life here that failed to gain his attention. He was chairman or the United Way Campaign. He was president of the Metropolitan Washington Board of Trade in 1971 and again in 1976 -- the only person ever to hold the post twice.

He tried to keep major league baseball in Washington and, after it was gone, he tried to bring it back. He served on various committees for the city government. He was chairman of the Mayor's Economic Development Committee and thus played a role in efforts to revive the neighborhoods that were burned and pillaged in the rioting that followed the assassination of the Rev. Dr. Martin Luther King Jr. on April 4, 1968.

Mr. Danzansky's response to the riots was a message that he was to repeat on numerous occasions in the ensuing years. It was this: If the business community is to continue to prosper, it must meet the legitimate needs of all its customers, the poor as well as the rich.

He had an immediate occasion to put his formula to the test. For in the spring of 1968, the Poor People's Campaign descended on Washington and camped on the Mall. News of the event, which was organized by the Southern Christian Leadership Conference. Dr. King's group, caused considerable disquiet among Washington businessmen.

Mr. Danzansky addressed a meeting at the Board of Trade. With an unabashed patriotism that was characteristic of him, he told his listeners that the poor people had a right to petition their government and that the best thing that Washington could do was show that that right would be respected. He urged his listeners to contribute to the welfare of the protesters while they were encamped here.

As the president of Giant, he set an example by contributing large quantities of his company's food. Other businessmen did likewise.

D.C. Del. Walter E. Fauntroy one of the organizers of the Poor People's Campaign, recalls that Mr. Danzansky "not only stood by us in our effort to conduct a meaningful and nonviolent campaign, but also through his good offices assisted us tremendously in seeing to it that the persons who came were adequately fed . . . Joe never wavered in his commitment to the cause of the poor and his efforts to bring the whole episode to a peaceful conclusion."

Fauntroy said last night that Mr. Danzansky's performance in those days were testimony to his "faith, courage and compassion in the business community."

The Poor People's campaign was a turning point, Fauntroy said, toward improving relations between the Board of Trade and "the activist community." An official of the Board of Trade credited Mr. Danzansky with "shaping the social conscience of the private sector in Washington in the spring of 1968."

Among other causes Mr. Danzansky espoused that of consumerism. In an address at the Smithsonian Institution in March 1975, he chided business for resisting consumer advocates.

He listed five responses businesses typically gave to consumerism, the first of which was to "deny everything." The fifth, he said, was a decision on the part of business managers to "do something about the problems.

"After repeated frustration, the awakening comes and business reappraises its entrenched viewpoint," he said. "It realizes that service to the consumer is its first obligation if it is to grow and prosper. It realizes that the best way to cope with the problems is to look at the allegations seriously, give responsible consumer spokesmen a fair hearing, and make a serious effort to do something constructive to correct any shortcomings."

In June 1977, he addressed a dinner which was sponsored by the Washington Urban League in honor of the memory of Whitney M. Young Jr. He called for "coalitions between the city and its suburbs, between blacks and whites, between business, consumers and labor, between labor and government and voluntary organizations."

The city, he said, had been shaken by the riots of 1968. "Our world is very different now," he said . "We are somewhat sadder, but hopefully somewhat wiser. An enormous unfinished agenda remains before us, even if we acklowledge the considerable distance we have already come."

On hearing of Mr. Danzansky's death, Mayor Marion Barry said the city had suffered a loss that "is well-nigh irreplaceable. Joe Danzansky has been involved in every facet of this city's life -- economic, social, cultural, civic, and has been the driving force behind so many, many positive things that have happened in our city."

Ester Peterson, a former White House consumer aide who later worked for Giant, said, "I think of this man's incredible courage when consumerism was a dirty word. I think he challenged a lot of American industry by his courage."

Robert R. Linowes, a former president of the Board of Trade, said Mr. Danzansky was "the kind of person who took great pride in the O Street Market situation. He had a great feeling for that kind of thing and was part of wanting to help and work in the city."

Last month, Giant opened a new market at 7th and P streets NW, across from the old O Sreet Market in the heart of the Shaw neighborhood. It is one of the first major new businesses in the area, one of the hardest hit by the 1968 riots.

Joseph Baer Danzansky was born in Washington on May 16, 1914. He graduated from old Central High School and earned his undergratuate and law degrees at George Washington University. He was admitted to the bar in 1936. In 1941, he formed a partnership with Raymond R. Dickey. He remained a partner of Danzansky & Dickey until 1964, when he became president of Giant.

Mr. Danzansky was a member of the boards of the Hebrew Academy of Washington, the Hebrew Home of Greater Washington and the Adas Isreal Congregation. He was a member of the executive committee of the United Jewish Appeal and an assistant treasurer of the Greater Washington Jewish Community Foundation. He also was a member of the National Press Club and Woodmont Country Club. He was a Mason and a member of the Almas Temple.

Survivors include his wife, the former Ethel E. Gelfand, of the home in Washington; two sons, Stephen I., of Washington, and Richard F., of Miami Beach, and four grandchildren.

Funeral services were scheduled for 1 p.m. Sunday at Adas Israel Congregation.