means to an end

[means to an end] {n. phr.} An action leading to some end orpurpose.

Money for him was just a means to an end; actually hewanted power.