Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in BI by (11.1k points)

I am having a sentence like this

Column1
I   have    too          much   space
123    big gap     456
asdfg   2z1xc2 

and I want to use white spaces between the text and How can I do this?

Coumn1
I have too much space
123 big gap 456 
asdfg 2z1xc2 . 

1 Answer

0 votes
by (22.5k points)
edited by

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: 

 

Related questions

0 votes
1 answer
asked Dec 13, 2020 in BI by Chris (11.1k points)
0 votes
1 answer
0 votes
1 answer
asked Mar 7, 2021 in BI by Chris (11.1k points)

Browse Categories

...