This paper deals with the fixed-time consensus for time-delayed microgrid via sampled-data control. First, a distributed fixed-time voltage consensus with delay compensation is designed using Artstein model reduction method. Then, by periodic sampling technology, a distributed fixed-time consensus via sampled-data control is designed to restore voltage in a fixed time. The Lyapunov theory is adopted to derive the fixed-time control stability and the consensus settling time bounds. In addition, the performance comparison between the continuous-time control and sampled-data control, delay compensation method, and switching communication topologies' effects are also provided. Simulation results validate the effectiveness of our proposed method.