Digitalization has enabled the potential for artificial intelligence techniques to lead the power system to a sustainable transition by extracting the data generated by widely deployed edge devices, including advanced sensing and metering. Due to the increasing concerns about data privacy, federated learning has attracted much attention and is emerging as an innovative application for machine learning solutions in the power and energy sector. This paper presents a holistic analysis of federated learning applications in the energy sector, ranging from applications in generation, microgrids, and distribution systems to the energy market and cyber security. The following federated learning-based services for energy sectors are analyzed: non-intrusive load monitoring, fault detection, energy theft detection, demand forecasting, generation forecasting, energy management systems, voltage control, anomaly detection, and energy trading. The identification and classification of the data-driven methods are conducted in collaboration with federated learning implemented in these services. Furthermore, the interrelation is mapped between the categories of machine learning, data-driven techniques, the application domain, and application services. Finally, the future opportunities and challenges of applying federated learning in the energy sector will be discussed.