Electric grids are traditionally operated as multientity systems with each entity managing a geographical region. Interest and demand for decarbonization and energy democratization is resulting in growing penetration of controllable energy resources. In turn, this process is increasing the number of grid entities. The paradigm shift is also fueled by increased adoption of intelligent sensors and actuators equipped with advanced processing and computing capabilities. While collaboration among power grid entities (agents) reduces energy cost and increases overall reliability, achieving effective collaboration is challenging. The main challenges stem from the heterogeneity of system agents and their collected information. Furthermore, the scale of data collection is constantly increasing and many grid entities have strict privacy requirements. Another challenge is the energy industry's common practice of keeping data in silos. Federated computation is an approach well suited to addressing these issues that are increasingly important for multi-agent energy systems. Through federated computation, agents collaboratively solve learning and optimization problems while respecting each agent's privacy and overcoming barriers of cross-device and cross-organization data isolation. In this paper, we first establish the need for federated computations to achieve energy optimization goals of the future power grid. We discuss practical challenges of performing multiagent data processing in general. Then we address challenges that arise specifically for orchestrating operation of connected distributed energy resources (DERs) in the Internet of Things (IoT). We conclude this paper by presenting a novel federated computation framework that addresses some of these issues, and we share examples of two initial field test setups in research demonstrations and commercial building applications with Grid Fruit LLC.