When a sentence is vacated and a new sentence is imposed upon the defendant for the same crime, the department shall credit the defendant with confinement previously served.
Wis. Stat. § 973.04
While periods of time served due to an indigent's inability to post bail prior to trial must be credited as time served on a prison sentence imposed, a court need not credit time served by an indigent offender against probationary confinement. State v. Avila, 192 Wis. 2d 870, 532 N.W.2d 423 (Ct. App. 1995). An offender is not entitled to additional sentence credit under this section when: 1) the vacated sentence was originally imposed concurrent to a separate sentence; 2) the separate sentence is not vacated; 3) the vacated sentence is reimposed consecutively to the non-vacated sentence; and 4) the time that the defendant requested was served in satisfaction of the sentence that was not vacated. State v. Lamar, 2011 WI 50, 334 Wis. 2d 536, 799 N.W.2d 758, 08-2206.