By Eugene L. Meyer

New York Times News Service

WASHINGTON — The Wharf is a gleaming, $2.5 billion development that has transformed a long-stagnant waterfront into a major destination in the nation’s capital.

Along a mile of the Potomac River is an array of high-end hotels, entertainment venues, shops, restaurants and apartments. They include the 6,000-capacity Anthem concert venue, an InterContinental hotel and Vio, a luxury condominium where prices have soared up to $2.9 million.

But the city has also required the developer to include affordable housing on the project’s 24 acres. Of the 761 units in the first phase of the development, 26% are listed as affordable and more are promised in the second phase.

From Washington to San Francisco, municipal leaders are facing increased pressure to provide affordable housing. Using a combination of government subsidies, tax credits and zoning changes, they are encouraging developers to incorporate affordable units into mixed-use projects.

The Wharf development is a partnership between PN Hoffman and Madison Marquette, developers based in Washington. Monty Hoffman, chief executive of PN Hoffman, takes pride in the affordable housing.

To make the Wharf project profitable, the partners sought to adjust the mix and build more units overall. The District of Columbia lowered its price for the land and reduced the percentage of lowest-cost housing while permitting more below-market, moderate-income “workforce” units.

“It allowed us to avoid residential offerings only at the extreme ends — deep affordable and waterfront market rate,” Hoffman said. Absent such concessions, he said, he would have needed more office, hospitality, retail and market-rate housing to make the numbers work.

“We did not want to create a tourist or office-centric park,” he said. “We wanted a balanced community.”

Developers across the nation are finding that economics are crucial in determining how many and at what price such units may be included for a mixed-use project to be both socially responsive and financially profitable.

To further construction of multifamily units, Minneapolis recently moved to rezone most of the city to ban new single-family homes. Several Sun Belt cities, including Atlanta, Austin, Texas, and Houston, now require a percentage of affordable units in any mixed-use project.

California’s landscape is more challenging. Its residential property tax cap, an amendment to the state constitution passed in 1978, known as Proposition 13, forced localities to push for commercial development to generate revenue for schools, parks, police and other public services.

Still, developers there are including moderate-income units in the mix, said Michael A. Covarrubias, chief executive of TMG Partners, a developer based in San Francisco. But, he added, the high cost of land has made that difficult. And the developer has to contend with residents opposed to gentrification in their neighborhoods. “Affordable housing has been unavailable,” Covarrubias said. “It’s a hornet’s nest and a complicated road you go down to get the volume you need.”

To help address the problem, the tech giant Google has pledged to invest $1 billion in land and money to build homes, including those deemed affordable in the Bay Area. In Northern Virginia, JBJ Smith has raised $78 million from investors for housing for those who earn too much for government help but not enough to afford homes.

The Metropolitan Washington Council of Governments has said the region needs more than 100,000 housing units by 2045, of which 40% should serve the lowest-income residents. The District of Columbia has set a goal of 36,000 units by 2025, of which 12,000 would be affordable. Mayor Muriel E. Bowser has offered solutions that include a $100 million annual housing production trust fund, regulatory relief and a higher building height limit.

The challenge for local governments is to find incentives like tax breaks that encourage developers, Brian T. Kenner, a former deputy mayor for planning and economic development, who left district government July 2 to work for Amazon, said. “Government can’t buy its way out.”

But government, he said, remains concerned about the negative impact of development, which can displace residents as it alters neighborhoods.