Whether a plea of previous conviction is available depends, in New Zealand, on the application of s 46 of the Criminal Procedure Act 2011. In particular, the phrase “arising from the same facts”: does the present offence arise from the same facts as an offence for which a conviction has been entered?
I used to think that this has the effect of requiring the prosecutor to allege all the relevant offences in the one proceeding, to avoid dragging things out with multiple separate prosecutions.
However, it has been made clear by the Court of Appeal that it is necessary to examine the essence of each charge and to compare the facts needed for proof to see to what extent there is an overlap. Some overlap will occur, but is it an overlap to the extent of giving rise to “sameness”? See Rangitonga v Parker  NZCA 166,  2 NZLR 796.
A clear explanation has been given recently (31 August 2021) in Mitchell v Police  NZCA 417. The Court adopted Venn diagrams as suggested by counsel. The issue was whether a conviction for driving with excess breath alcohol was a bar to conviction for driving on the same occasion contrary to the terms of a zero alcohol licence. The common fact was driving with alcohol in the breath (not per se an offence). The offences were held not to arise from the same facts, because in essence the breath alcohol offence arose from the level of alcohol in the driver’s breath, and the licence offence arose from the zero alcohol terms of the licence.
The Court noted at  that it did not favour the analysis which seems to have found favour with the Supreme Court of South Australia in two cases advanced by the appellant: Arthur v Police  SASC 213, (2008) 101 SASR 529 at  and Jones v Police  SASC 36, (2019) 135 SASR 255 at .
Update: on 14 December 2021 the Supreme Court granted leave to appeal.