Power Query M code
let
Source = YourTable,
Cleaned = Table.TransformColumns(Source, {{"ColumnName", each Text.Combine(List.Select(Text.Split(Text.Trim(_), " "), each _ <> ""), " "), type text}})
in
Cleaned
Collapses repeated spaces inside a text value down to a single space, in addition to trimming the ends.
let
Source = YourTable,
Cleaned = Table.TransformColumns(Source, {{"ColumnName", each Text.Combine(List.Select(Text.Split(Text.Trim(_), " "), each _ <> ""), " "), type text}})
in
Cleaned
Text.Trim only removes leading/trailing spaces; this also fixes double spaces in the middle of the text.
Browse all 145 snippets in the Power Query M Code Snippets, or search the library for something similar to Remove Extra Spaces Between Words.