You may be able to get there by using a derailleur hanger extender like the Wolftooth Goatlink/Roadlink or similar. Just be aware of your rear derailleur's capacity. 11-42t is more often used as a cassette for 1x drivetrains. Friends using the extenders have had good luck with them and swear by them.