He has surived a rocky path to the final after dropping a set against earlier tournament opponents Roberto Bautista Agut and Jo-Wilfied Tsonga.
Belgian David Goffin defeated Matteo Berrettini 7-6 (7-4) 6-3 to reach his first ATP final since 2017.
"The last couple of days were hard, that's why I am thrilled to be in the final," Federer, who was facing his 337th different opponent, said.
"Otherwise he would have had a couple of chances... I played well from the start. That was the key to stay focused from the start. I'm playing well, more aggressive... so, it's a great feeling this week to be in the final."