Once we send the data to an Excel Table, we see that there are 283 rows in the query output.
Without changing ANYTHING, we refresh the query and observe what happens to our row count.
Each time we refresh, the row count increases to an unexpected value.
The problem is that the output query is storing its results in the same file as the source material, and it is storing it as a proper Excel Table.
This means that each time the query refreshes, it will read EVERY table in the workbook, including the output table. We refer to this as “the snake eating its tail.”
We can see from the Source step in the query that the query output table is seen as a viable input table.
To exclude the output sheet from the Refresh operation, we can insert a step in the query after the Source step that filters the table to only include tables whose table names begin with “Data_”.
This ensures the result table is not included in further updates.