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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

How to get data cleaned up

I have a table with multiple columns

 

How can I only get customer name when some line items have partner info followed by :

 

If I extract before: it also removes the customer name with no :

 

i.e. I only want to remove AT&T

Capture.JPG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

In such case, I would add a colon to those values which don't have it at approriate place and then apply the transformation 

View solution in original post

9 REPLIES 9
BA_Pete
Super User
Super User

*EDIT* Ignore this answer, @Anonymous 's solution is the way to go. Much tidier 🙂

 

Hi @Anonymous ,

 

In Power Query, open a new blank query and paste this code over the default:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcgyJKTUwMDILsVJwzE2tUIrVQRHzdPJFFwr2cPXxAQs6Ofp5K/i7KTj6ugZ5OjtCxYKcfRwjg5ViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [customerAccount = _t]),
    #"Split Column by Delimiter" = Table.SplitColumn(Source, "customerAccount", Splitter.SplitTextByEachDelimiter({": "}, QuoteStyle.Csv, false), {"customerAccountSplit", "customerAccount"}),
    #"Replaced Value" = Table.ReplaceValue(#"Split Column by Delimiter", null, each [customerAccountSplit], Replacer.ReplaceValue,{"customerAccount"}),
    #"Removed Columns" = Table.RemoveColumns(#"Replaced Value",{"customerAccountSplit"})
in
    #"Removed Columns"

 

 

The steps I took:

1) Split original column by ": " delimiter

2) Replaced null values in split column 2 with values from split column 1

3) Removed split column 1

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Pete

 

Thank you for a quick answer

 

Unfortunately, my skill level is not allowing this to work for me

 

Splitting the column is easy and can see null in many places

 

BUT

 

Embarrassingly I cannot see how to Open a new blank query

 

The replace function seems to replace one value with another, not from other columns

 

Sorry but I am very new to Power BI and was hoping this extract would be very easy

Anonymous
Not applicable

In Power Query, select the column and go to Transform Tab.

NikhilKumar_0-1614099057344.png

 

Click on Extract and select Text after delimeter.

Provide the input as below-

NikhilKumar_1-1614099132809.png

 

 

Anonymous
Not applicable

Sorry this gives the opposite to what I required 

I need the text after the delimiter and not to delete the customers without a delimiter

Anonymous
Not applicable

If you expand the advanced options and set the scan as from the end of the input, it should work the way to want. I verified this with a sample data

 

Before- 

NikhilKumar_0-1614153122534.png

After-

NikhilKumar_1-1614153159869.png

 

Anonymous
Not applicable

You can try below steps:

1. I have created a sample data with one row

gauravtanwar_0-1614098406427.png

2. Right click on header. Go to split column and choose 'by delimiter'

3. Fill the pop up window like below and click on okay

gauravtanwar_1-1614098630274.png

4. your data is now split

gauravtanwar_2-1614098692452.png

 

 

 

Anonymous
Not applicable

Sorry this is what I have been doing but it removes the original customer without a delimiter see attachmentCapture1.JPG 

Anonymous
Not applicable

In such case, I would add a colon to those values which don't have it at approriate place and then apply the transformation 

Anonymous
Not applicable

Was my mistake

 

Thank you, for sticking with me 🙂 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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