Anthony Williams has wanted this for years. Perhaps longer than Jim Kenney had even thought about when he’d make the run for the mayor’s office.

But it was back in 2011 when a locally-connected politico told Philadelphia Magazine that Williams didn’t seem to have the coalition-forging power that’s required to win a seat in major office here in Philly — “I don’t see him building any effort to do much of anything,” the insider said.

That power to bring together coalitions through good ol’ fashioned elbow grease belonged to Kenney, the ultimate victor of today’s Democratic primary for mayor of Philadelphia (and the likely winner in the November general election.)

Now, Williams, who’s run for and lost major public office before, will have to return back to his high-powered job as a top Senator in Harrisburg. There, he’ll help steer the legislative ship. But he won’t be driving anything as a chief executive.

“I want to have the opportunity to use what I entered politics for — and that’s a legacy from my family — to help those who need help,” he said in February, “and put those who may be least served at the forefront of the conversation.”

Williams was one of the first people to come out and say definitively that he was running for mayor. He has a huge voter base in West Philly, the backing of a number of public officials and the upside of racial math to his credit. He’s been identified as the frontrunner as recently as February.

He even had the early-on support of Rep. Bob Brady, the leader of the Philadelphia Democratic Party, and plenty of other top pols who had staunchly supported Williams’ father, Hardy Williams, a Philadelphia political institution who once ran for mayor himself four decades ago.

On top of that, Williams has Harrisburg to vouch for him. He’s the minority whip in the state Senate (AKA the No. 2 guy for the Senate Dems) and is one of the chairs of the powerful State Government Committee. He had the ability to tout all day that he has connections in the capital that no other candidate could claim.

So what happened?

It wasn’t a lack of money. Williams’ campaign set a record this year for the largest concentrated ad buy for a mayoral candidate after American Cities, a PAC that supports him, purchased nearly a million bucks worth of ads to run solely in the last week of the campaign.

That huge ad buy from the PAC took its overall spending on Williams’ candidacy to about $5.2 million — much higher than what Kenney was able to raise, even through his dark money union support. (Of note: The same PAC also bankrolled Williams’ failed run for governor with more than $5 million in 2010.)

The financial resources were in some ways Williams’ downfall. The American Cities PAC is funded by three billionaires who live on Main Line and run the Susquehanna Investment Group — they’re huge charter school advocates, so is Williams. And he caught a lot of flak for that.

But in the end, it was Kenney who did exactly what that political insider said four years ago that Williams couldn’t do: Forge coalitions.

The former councilman knew he had unions on his side, and after that he went after legions of groups from the LGBT vote to the millennials and, along the way, secured a significant portion of the black vote. He even swiped away the endorsement of Rep. Dwight Evans, a longtime mentor of Williams, along with a coalition of powerful black leaders who are members of the Northwest Coalition.

As Kenney gained momentum and the endorsements rolled in, Williams needed to do something to save his campaign, so he capitalized on the #BlackLivesMatter movement and said he’d fire Police Commissioner Charles Ramsey as a means to get rid of stop-and-frisk in the city.

It now appears that move backfired. An Inquirer/ Daily News/ NBC 10 poll released last week showed Kenney held a double-digit lead over Williams, and those polled were apparently “overwhelmingly positive” about Ramsey. The pollster told The Inquirer that “the lesson here is you don’t pick on a popular guy.”

What may have given Kenney a boost so he could seal the deal over Williams has been pointed out before: At least in part, his personality — the likeable South Philly bravado. Of any candidate, Kenney was best able to portray himself as a leader and excite larger groups of Philadelphians than his peers were. Williams’ relatively laid-back demeanor ended up hurting him in the end.

And then there’s Johnny Doc. Philadelphia’s top organized labor boss John Dougherty is a power broker and the business manager of electricians’ union IBEW Local 98. The 5,000-member union is the largest independent source of campaign money in Pennsylvania and has succeeded at getting its members — Bobby Henon and Ed Neilson — elected to City Council.

After Dougherty threw his support behind Kenney, other unions followed, including the powerful Philadelphia Federation of Teachers. Philly is a union town, and those thousands of workers in trade unions hit the streets armed with information, giant Kenney heads on sticks and a boatload of influence.

They were likely the difference-makers.

So in that same Philadelphia Magazine story published four years ago, Williams asked the reporter at the time a question: “Am I a big personality?”

It appears now that the answer is “not big enough.”

Anna Orso was a reporter/curator at Billy Penn from 2014 to 2017.