WATCH the Madrid Open LIVE & ONLY on beIN SPORTS | available via Foxtel, Kayo Sports, Fetch TV & beIN SPORTS CONNECT
Barty took her winning streak on the red clay to 15, overcoming ninth seed Petra Kvitova 6-1 3-6 6-3 to reach the last four in Madrid for the first time.
Among active players, the Australian's red-clay run is bettered only by Serena Williams (32 matches in 2013-14) and Sara Errani (16 in 2012).
The 2019 French Open champion is 24-3 for the season and has now won her last 10 matches against top-20 opponents and five of the last six with Kvitova.
Kvitova's hopes of claiming a rare win over Barty were boosted when she sent the match to a decider, but Barty took her formidable record in three-setters this year to 11-1.
"It's just always staying in the fight," Barty said of her performance in deciders this season. "Always staying in the hunt and never letting it slide away.
"That certainly doesn't guarantee results, doesn't guarantee success. It guarantees you give yourself the best chance to do what you do and to figure it out and to find your way."
Finding her way on the WTA Tour is 23 year-old Badosa, who moved up to a career-high ranking of 62 after a run to the semi-finals in Charleston last month.
She defeated Barty in straight sets en route to the last four having beaten Belinda Bencic earlier in the tournament.
Badosa got the better of Bencic again on home soil, prevailing 6-4 7-5, the Swiss paying the price for a string of unforced errors at the end of each set.
"I expect a completely different match," Badosa said of the reunion with Barty.
"She's the number one in the world. Now she knows me. Number one in the world, they don't like to make mistakes two times in a row, so for sure I expect a tough match and completely different to Charleston."
Aryna Sabalenka is through to the semi-finals after Elise Mertens retired from their clash with a thigh injury. Sabalenka had held a commanding 6-1 4-0 lead.
She will face Anastasia Pavlyuchenkova, who is into her first WTA 1000 semi in over a decade after recording her fourth top-25 win of the week by defeating Karolina Muchova in straight sets.
At L'Open 35 de Saint-Malo, sixth seed Arantxa Rus and seventh seed Jasmine Paolini each lost in the round of 16 but fifth seed Viktorija Golubic fought back to defeat Greet Minnen in three sets.