I didn't look in details to your query so not sure it will deliver what you expect. However, to make it "acceptable" from a syntax perspective it should like this:
let
Source = Csv.Document(...),
#"Promoted Headers1" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Replacer.ReplaceValue" = Table.FromRecords(
Table.TransformRows(#"Promoted Headers1",
(row) as record =>
if row[Category] = "Household"
then
Record.TransformFields(row,
{<!-- -->{"Category", each "Household"}, {"Category", each "Utility"}}
)
else row
)
)
in
#"Replacer.ReplaceValue"
PS Please update the title of your thread so it better reflects the issue. Thanks