Before you merge, it helps to know exactly how many records DataMergeStudio will produce. The record count is that number – and where your data "ends" decides it.
Your record count comes from the master sheet: each master row is one record. Five product rows means five product documents; two hundred attendee rows means two hundred badges. Secondary rows don’t add to the count – they’re pulled into records through data groups, not counted as records themselves.
DataMergeStudio works out the extent of your data so it doesn’t merge empty trailing rows. The practical advice is to keep your master sheet tidy: real records in a continuous block, no blank rows scattered in the middle, and nothing stray left far below the last record. A clean sheet makes the count obvious and predictable.
The record count is one of the fastest ways to catch a data problem before you produce anything:
Check the count, and if it doesn’t match what you intended, fix the sheet and reload before merging.
Back to the start of the data story, or on to the layout: What Is a Datasource?