In query editor look at this function
(text as text, optional char_to_trim as text) =>
let
char = if char_to_trim = null then " " else char_to_trim,
split = Text.Split(text, char),
removeblanks = List.Select(split, each _ <> ""),
result = Text.Combine(removeblanks, char)
in
result
You can register for this online Power BI training course by Intellipaat to learn Power BI.
Get an introduction to Power Bi from the below video: