Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Ennygreat
New Member

Please I need help

Ennygreat_0-1715451654560.png

 

Inconsistent data.JPG

I'm trying to work on a column using power query and I encountered an inconsistent data entry. The region doesn't align and was repeated with different space method. Kindly see attached screenshot document the region segment to understand better and if you can profer solution for me. Thank you. 

2 ACCEPTED SOLUTIONS
GauravAher
New Member

Hi,

 

To remove leading and trailing spaces from your data, use the Trim function. First, go to the Transform Data page, select the Region column, right-click, choose Transform, and select Trim.

I made a YouTube video on this issue. If my solution helps you, please subscribe and like the video at
https://youtu.be/2H-DASuXF6A 

Thank You

 

 

 

View solution in original post

dufoq3
Community Champion
Community Champion

Hi @Ennygreat, if you also have spaces between words - you can do this:

 

Result

dufoq3_0-1715606917933.png

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUlBwLC0uKUrMyUxUitWJVgrNyyxJTVHwzsxLT8nPBQspKPilliuAQFRqYk5iXgpUVCE4tSgJpC0WAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    Ad_RemovedSpaces = Table.AddColumn(Source, "Removed Spaces", each Text.Combine(List.RemoveMatchingItems(Text.Split([Column1], " "), {""}), " "), type text)
in
    Ad_RemovedSpaces

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

5 REPLIES 5
dufoq3
Community Champion
Community Champion

Hi @Ennygreat, if you also have spaces between words - you can do this:

 

Result

dufoq3_0-1715606917933.png

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WUlBwLC0uKUrMyUxUitWJVgrNyyxJTVHwzsxLT8nPBQspKPilliuAQFRqYk5iXgpUVCE4tSgJpC0WAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    Ad_RemovedSpaces = Table.AddColumn(Source, "Removed Spaces", each Text.Combine(List.RemoveMatchingItems(Text.Split([Column1], " "), {""}), " "), type text)
in
    Ad_RemovedSpaces

 


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

GauravAher
New Member

Hi,

 

To remove leading and trailing spaces from your data, use the Trim function. First, go to the Transform Data page, select the Region column, right-click, choose Transform, and select Trim.

I made a YouTube video on this issue. If my solution helps you, please subscribe and like the video at
https://youtu.be/2H-DASuXF6A 

Thank You

 

 

 

Thank you 

Anonymous
Not applicable

You can add a column using each Text.Trim([Region]), or just select the Region column and use the Trim GUI command.

 

--Nate

Ennygreat
New Member

Someone should please attend to this if you know how to solve it. Thank you 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.