By Paul Vieira

OTTAWA--Canadian retail sales slowed in July after a record gain in the previous month, with activity at automobile dealerships and gasoline stations powering results. Excluding those two components, retail sales fell.

Retail sales climbed 0.6% in July from the previous month to a seasonally adjusted 52.86 billion Canadian dollars, or the equivalent of $40.04 billion, Statistics Canada said Friday, following a revised 22.7% advance in the previous month.

Market expectations were for a 1% gain, according to economists at Royal Bank of Canada. The data agency said last month it expected retail sales to rise 0.7% in July.

In volume, or price-adjusted, terms, July retail sales jumped 0.4% from the previous month.

Royce Mendes, economist at CIBC Capital Markets, said Canada's retail-sales report doesn't incorporate the services on which households spend. "Many more services were available in July," he said, citing the relaxing of virus-related restrictions, "and some spending was likely diverted away from goods and back towards services. As a result, overall spending numbers might not have seen a similar stall."

In a separate release Friday, Statistics Canada said wholesale transactions climbed 4.3% to a record C$64.97 billion. Wholesale trade is the largest component of Canada's services sector.

Nominal retail sales have recovered to surpass levels in February, or before authorities imposed widespread economic restrictions to contain the spread of the new coronavirus. "The recovery in total retail sales has been V-shaped," the data agency said in its report on July data.

Further, Statistics Canada said its initial estimate for August indicates a climb of 1.1% in retail sales.

The data agency said sales climbed in six out of 11 subsectors tracked in July, with motor vehicle and parts dealers, up 3.3%, and gasoline stations, up 6.1%, accounting for the bulk of the month-over-month gain. Excluding those two sectors, the data agency said retail sales fell 1.2% in the month.

Among retail components recording declines were building material outlets, down 11.6%, and grocery stories, down 2%.

Write to Paul Vieira at paul.vieira@wsj.com