Murray made it to his third Wimbledon final with a ruthless 6-3, 6-3, 6-3 demolition of Czech 10th seed Tomas Berdych, while Raonic stunned Federer with a 6-3, 6-7 (7/3), 4-6, 7-5, 6-3 victory.
Raonic's first win on grass against a top 10 opponent shattered Federer's hopes of claiming a record eighth All England Club crown and 18th major.
The 34-year-old Swiss star was on the brink of becoming the oldest All England Club finalist in 42 years when he took a two sets to one lead, but the big-serving Raonic hit back to avenge his 2014 Wimbledon semi-final loss against Federer.
"There was a little opening and I took it," said Raonic, who is the first Canadian man to make a grand slam final.
While Federer is firmly in the twilight of his glittering career, Murray is in his prime as he tries to become the first British man to win multiple Wimbledon titles since Perry in the 1930s.
The 29-year-old made just nine unforced errors, in contrast to 30 by the befuddled Berdych, who was powerless to halt Murray's progress to an 11th grand slam final appearance - a milestone which took him ahead of Perry as the British man with the most major finals on his CV.
Refusing to rest on his laurels, Murray said: "Milos is playing some of the best grass-court tennis of his career.
"I'm aware I'll have to play very well to win.
Path to the final
- R1: bt Pablo Carreno Busta 7-6, 6-2, 6-4
- R2: bt Andreas Seppi 7-6, 6-4, 6-2
- R3: bt Jack Sock 7-6, 6-4, 7-6
- R4: bt David Goffin 4-6, 3-6, 6-4, 6-4, 6-4
- QF: bt Sam Querrey 6-4, 7-5, 5-7, 6-4
- SF: bt Roger Federer 6-3, 6-7, 4-6, 7-5, 6-3
- R1: bt Liam Broady 6-2, 6-3, 6-4
- R2: bt Lu Yen-Hsun 6-3, 6-2, 6-1
- R3: bt John Millman 6-3, 7-5, 6-2
- R4: bt Nick Kyrgios 7-5, 6-1, 6-4
- QF: bt Jo-Wilfried Tsonga 7-6 (12/10), 6-1, 3-6, 4-6, 6-1
- SF: bt Tomas Berdych 6-3, 6-3, 6-3