Inner Trim in Power BI

  • Published
  • Posted in Power BI
  • Updated
  • 1 min read
  • Tagged as

Hello reader, you all must know how to remove the unwanted spaces or non-printable object in Power Query. What you will do if there is extra spaces present between the word?

City

In this blog, we will see how to remove extra spaces between the works AKA Inner Trim using Power Query.
Let’s get started…

Step 1: Go to Power Query Editor

Power BI Query Editor

Step2: Create a custom column “Split.1”

Custom Column

Split 1 = Text.Split([City],” “)
This will give you a list of elements.

Power BI

Step 3: Now, we will shrink the list based on the non-null element.

Power BI Custom Column

Shrink.1 = List.Select([Split.1], each _ <> “”)

Step 4: Now, we just have to combine Shrink.1 column to get the desired output.

Custom Column

Combine = Text.Combine([Shrink.1], ” “)

This is how you can perform Inner Trim using Power Query. I hope you will find this blog useful.

Thank you for reading this blog. Keep learning…

Gaurav Lakhotia
Sr. Data Analyst
Addend Analytics

Addend Analytics is a Microsoft Gold Partner based in Mumbai, India, and a branch office in the U.S.

Addend has successfully implemented 100+ Microsoft Power BI and Business Central projects for 100+ clients across sectors like Financial Services, Banking, Insurance, Retail, Sales, Manufacturing, Real estate, Logistics, and Healthcare in countries like the US, Europe, Switzerland, and Australia.

Get a free consultation now by emailing us or contacting us.