This user's approach is exactly right, and their frustration with the table output is a sign they are thinking clearly. They have already solved the hard part: dynamically selecting columns that start with "cdp", removing nulls, and combining the remaining values with a semicolon. The code is smart, flexible, and handles any number of columns. What they are stuck on is a formatting detail, not a logic problem. That is a good place to be.
The issue is a subtle one in Power Query. When you use `Table.AddColumn` with a function that returns a list, Power Query often wraps that result in a nested table structure rather than a plain text string. The user's `Text.Combine` is correct, but the way they are calling `Record.Field` inside `List.Transform` is producing a list that Power Query treats as a record field, not a simple text value. The fix is straightforward: ensure the `Text.Combine` is applied at the row level, not as a transformation of the column list itself. A cleaner version of their code would be: `Table.AddColumn(Source, "merge", each Text.Combine(List.RemoveNulls(List.Transform(LabelColumns, (col) => Record.Field(_, col))), ";"), type text)`. The key change is moving the `type text` declaration inside the function so that Power Query knows to output a string, not a table.
For the working data professional, this is more than a syntax fix. It is a reminder that Power Query rewards precision with performance. The dynamic column selection they built is the kind of pattern that scales across datasets, months, and projects. Once they have the text output working, they can wrap this logic into a reusable function or a custom parameter. That means next month, when their source data has 12 "cdp" columns instead of 4, the query will adapt without a single edit. That is the real win: not just fixing today's problem, but building a query that stays out of your way tomorrow.