In this note we associate to any compact $C$ in an ultrametric space $(X,d)$ a real valued and a $p$-adic valued measure $\mu _C$. We prove that any $p$-adic valued continuous function $f:C\rightarrow {\bf C}_p$ is $\mu _C$ -integrable. Using this measure we extend the definition of the trace function [2] to any $T\in {\bf C}_p$.