LOCAL by-elections usually only attract interest as glorified opinion polls.

Thursday's two by-elections in Dundee mattered in a more direct way, because the SNP's slim overall majority on the city council was at stake.  If they had lost both contests, they would have slipped to minority status and Labour might even have seized control of the council.  Instead the SNP won both seats and now have more of a cushion than before.

The situation in Lochee 

The result in the Lochee ward was the closer of the two but also the most satisfying for the SNP.  Of the eight wards in the city, Lochee was the only one where the SNP and Labour were relatively closely-matched in the popular vote at the last local elections in May 2022.  Less than a 4% swing at the by-election would have put Labour into the lead on first preference votes, which shouldn't have been an overly challenging task given the enormous swings Labour racked up at the general election only three months ago.

READ MORE: Dundee: Labour blame Winter Fuel Payment cut for by-election losses

But remarkably, the SNP kept the swing down to just under 3%. To put that in perspective, the same swing at a Scotland-wide level would translate to an SNP lead over Labour of almost seven percentage points – a complete transformation from Labour's five-point national lead at the General Election.

The SNP will also be encouraged that their slender 1.7% lead over Labour on first preferences in the ward was, perhaps surprisingly, enough to win even after the Tories, Liberal Democrats and the anti-independence Workers Party of Britain were eliminated and their votes transferred in line with the next highest preferences. 

Curiously, that can be partly explained by the fact that the number one destination of vote transfers from the Workers Party was the pro-independence Alba Party.

READ MORE: Ex-Scottish Labour leader invites business chiefs to private Treasury meeting

What about Strathmartine?

In the Strathmartine ward, the SNP were defending a much more comfortable lead from last time, but their vote also fell more sharply.  They defeated the second-placed Liberal Democrats by a comfortable eight percentage points, but suffered a swing of around 7% to Labour, which would translate to a small Labour lead across Scotland. 

Nevertheless, an average of the swings in the two by-elections would put the SNP around two points ahead of Labour nationally, and they'll be more than satisfied with that so soon after their setback on July 4.