All of the GTX-10 series are compatible with Z270 motherboards, don't worry.
What matters is your case and the card. The 540 may have limited space, so you'll have to research with 1070 you're getting and how big it is. Cards like the Zotac 1070 Amp, MSI 1070 Armor will fit without a problem. But huge cards like the 1070 Amp extreme and the 1070 G1 gaming have huge heatsinks, and can be really Long. You'll have to see how much room there is in your case and research the dimensions of the card you're buying