 Federer then played in the Shanghai Masters . He beat Novak Djokovic in the semifinals , ending the Serb 's 28 @-@ match unbeaten run on Chinese soil . He battled Frenchman <unk> Simon in his second Shanghai final , defeating him in two tiebreak sets and collected the 23rd Masters 1000 title of his career . The victory saw Federer return to world No. 2 for the first time since May 2013 . Federer then played the Swiss Indoors in October , where he won a record sixth title and his 82nd ATP men 's singles title overall . Federer also reached the finals of the 2014 ATP World Tour Finals to face Djokovic again , but withdrew from the final because of another back injury from his semifinal match against Stan Wawrinka . Despite his injury , Federer finished the season on a high by defeating Richard <unk> to clinch the Davis Cup for Switzerland for the first time in its history . 
