The London-wide annual target for new units of affordable housing is 17,000, although councils set their own levels.
Only 8,550 such units were built in developments with affordability requirements in 2015-16 - down from 10,962 the previous year.
Lewisham was the only borough to meet or exceed all its targets over the past three years.
"House prices are rising six times faster than wages and rents [are] sky high," said Campbell Robb, chief executive of Shelter.
He said "thousands of homeless families in London right now - over 2000 in Hackney alone" were "trapped in temporary accommodation because there's nowhere they can afford to live."
Mayor of London Sadiq Khan, has promised "thousands of new affordable homes to both buy and rent".
Under the London Plan, the councils' self-set affordable homes targets range from an overall target of 25% in Croydon to 50% in boroughs such as Hackney, Lewisham, Islington and Camden.
Councils met only two-thirds of their targets in the last three years, and 16 of the 21 councils that responded to the BBC's Freedom of Information request missed their targets every year.
While the number of homes built in developments with affordability requirements between 2013-16 rose, the percentage that were affordable fell from 31.3% to 23.5%.
Councils can require large housing projects with more than 10 units to provide affordable housing under the Town and Country Planning Act 1990.
However, they are not doing so and developers are using viability assessments to argue that to provide affordable housing would make the development non-viable, and thus exempt from housing requirements.
Instead, councils are taking payments in kind, with so-called s106 payments (money given to councils to secure planning permission) increasing from £184m to £235m between 2014 and 2016.
Greenwich alone received more than £71m in s106 payments last year - up from just under £10m in 2013-14.
Only a quarter of its new housing was affordable, against a target of 35%.
Mayor Sir Steve Bullock, London Councils' executive member for housing, said planning affordable housing "can be a complex process".
"For instance, putting pressure on developers to build higher proportions of affordable housing can result in fewer homes in total being built," he said.
"Should developers prove that affordable housing requirements will threaten the viability of an entire project due to market conditions, boroughs try to negotiate a compromise that still benefits their local communities."
One council, Harrow, did not respond to the BBC's request for data.
London boroughs are failing to ensure developers provide affordable housing, figures obtained by the BBC show.