Table functions return transformed tables. Table.SelectColumns narrows the schema, Table.SelectRows narrows the rows, and Table.Distinct removes repeated combinations of selected fields. Neither filtering nor grouping changes the source file. You get a new table value at each stage.
Decide what one output row represents before you write M. A team lookup should have one normalized team per row. An operational exception list must preserve the original record IDs. A count table has a single aggregate result. These outputs use different functions even when they start from the same extract. Check the column names too: a renamed field is part of the contract with whoever consumes the result. The hidden file changes row counts and values, so an answer built from a remembered total cannot pass.