Forum Discussion
Rows Disappear after double ReplaceValue Steps
Hi,
Likely cause: query folding + case-insensitive SQL collation. Remove Duplicates is case-sensitive in the M engine, but if that step folds to the source (SQL Server default collation is usually case-insensitive), 7311A and 7311a get treated as duplicates there and one gets silently dropped. Your "unrelated" changes shift where folding breaks, which flips whether dedup happens locally (case-sensitive, keeps both) or at the source (case-insensitive, collapses to one).
Quick test: Add Table.Buffer() right before Remove Duplicates. If the row reappears, that confirms it.
Fix: Buffer before dedup, or dedupe on a normalized helper key (Text.Upper()), or force a binary collation at the source.
Auditing tip: Add a small side query logging Table.RowCount() at each major checkpoint (post-source, post-merge, post-dedupe, post-filter) so silent drops show up automatically on refresh instead of manual comparison.