Ratings measurement firm Nielsen said profit grew in the latest quarter, as lower costs offset a sales decline and the company came up against a favorable comparison.

Nielsen tracks about 1,000 shows and provides media giants such as Comcast Corp.’s NBCUniversal, Time Warner Inc. and 21st Century Fox with data on viewing trends. The New York-based company has in recent months been scaling up a program to track viewing on Netflix and online services such as Amazon.com Inc.’s Prime Instant Video, hoping to stifle criticism that...