Is the bottom one your desired result?
separate the text from the shadow. Select the text then shift select the shadow, choose back minus front from the options on the toolbar. Export as transparent png.