Retailers Walmart and Target are in strong positions that could bolster investor portfolios, according to KeyBanc. The firm on Tuesday initiated coverage of both retailers with overweight ratings and price targets signaling potential future share growth. KeyBanc gave Walmart a $155 price target, implying a more than 14% upside, and Target a $200 price target, meaning shares could jump more than 20%. "While investors can find better growth potential in smaller companies, we believe both Walmart and Target are in the best competitive positioning of the past decade, given the pandemic's catalyst of e-commerce becoming significantly more important," wrote KeyBanc Capital Markets analyst Bradley Thomas. In addition, both companies will have favorable share gains from smaller companies over the next two-to-three years if they continue to leverage their grocery delivery and pickup businesses, Thomas wrote. "Ultimately, our OW ratings are underpinned by an outlook for defensive growth, share gains, and margin recovery to normal levels," said Thomas. Margins returning to normal Both companies over-earned during the pandemic but are under-earning now, compared to historical margins, due to inventory issues stemming from supply chain problems. Walmart's latest earnings beat Wall Street expectations on the top and bottom lines, but the company cut its profit outlook , saying consumers are showing weaker spending habits due to inflation. Target's most-recent earnings took a huge hit as the company had to slash prices to clear a glut of inventory. The company kept its own full-year outlook however, and said it's positioned to rebound. Going forward, though, margins should start normalizing for both companies, Thomas said. There's also positive data signaling better third quarters for both companies after rough second-quarter earnings. Even though consumers may pull back spending in the next year due to recession fears, back-to-school is looking solid for Walmart and Target according to KeyBanc's geolocation and credit/debit card data. "Both companies could deliver upside to expectations in 3Q, with the worst markdown issues likely behind us," Thomas said. Target shares have struggled in 2022, losing 28.2% in 2022. Walmart's stock has fared much better in that time, though it's still down 6.6% year to date. —CNBC's Michael Bloom contributed reporting.