The power loss and electromagnetic energy density of a metamaterial consisting of arrays of wires and split-ring resonators are investigated. We show that a field energy density formula can be derived consistently from both the electrodynamic (ED) approach and the equivalent circuit (EC) approach. The derivations are based on the knowledge of the dynamical equations of the electric and magnetic dipoles in the medium and the correct form of the power loss. We discuss the role of power loss in determining the form of energy density and explain why the power loss should be identified first in the ED derivation. When the power loss is negligible and the field is harmonic, our energy density formula reduces to the result of Landau's classical formula. For the general case with finite power loss, our investigation resolves the apparent contradiction between the previous results derived by the EC and ED approaches.