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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Aaron_M
Regular Visitor

Trim and Clean not working to remove hidden space/row from SharePoint list data set

ISSUE

Trim and Clean not working to remove hidden space/row from SharePoint list data set.

 

IMPACT

The extracted text doesn't correctly alpha filter. Cells with the hidden space/row will present above intended extract cells.

Example:

TitleQuantity
Example A1
Example C1
Example A1
Example B3
Example C7

 

NOTE: Data set has been pulled from a SharePoint list. Deleting blanks contents from the applicapble SharePointfield will correct the Extracted data, however i would like Power BI to fulfill via query to save manual corrections. 

Example of raw impacted data field. + Example A

<div class="ExternalClassEC0B3A6B0798419A9A35C5646E0D5F15"><html>
<p>​Example A<br></p>
</html></div>

Example of raw workable data field = Example B

<div class="ExternalClassF70CB82314354D9BADA5F784FF923F9D"><html>
<p>Example B<br></p>
</html></div>

 

What I tried in Transform data (simplified version)

1. 'Clean' relevant column (Result is that it pulls it into 1 cell row) 

2. Extract text before delimiter: <br>

3. Extract Text after delimiter; Starting from end: >

4. 'Trim' relevant column

5. 'Clean' relevant column just for good measure

6. Results Example A, Example B ect. However if Example B has a hidden space/row it will appear first in the filtering.

 

PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Actually when you paste the data, then you will lose whitespaces. Hence, from pasted data, it is not possible to know what whitespaces are there. While it will need the sample data to see what whitespaces are there but there is another way to retrieve what you want. Since you have only text and numbers to be retrieved+space, Just insert following statement where data is the column which has Example A, Example B results and Source is your previous step

 

= Table.ReplaceValue(Source,each [data],each Text.Select([data],{"0".."9","a".."z","A".."Z"," "}),Replacer.ReplaceText,{"data"})

 

 

View solution in original post

4 REPLIES 4
Vijay_A_Verma
Super User
Super User

Actually when you paste the data, then you will lose whitespaces. Hence, from pasted data, it is not possible to know what whitespaces are there. While it will need the sample data to see what whitespaces are there but there is another way to retrieve what you want. Since you have only text and numbers to be retrieved+space, Just insert following statement where data is the column which has Example A, Example B results and Source is your previous step

 

= Table.ReplaceValue(Source,each [data],each Text.Select([data],{"0".."9","a".."z","A".."Z"," "}),Replacer.ReplaceText,{"data"})

 

 

Thanks Vijay_A_Verma

I wasn't able to apply correctly. Token Comma expected at {"0".."9","a".."z","A".."Z"," "}

 

The last few lines i have is:

#"Extracted Text After Delimiter" = Table.TransformColumns(#"Inserted Text Before Delimiter", {{"Text Before Delimiter", each Text.AfterDelimiter(_, ">", {0, RelativePosition.FromEnd}), type text}}),
#"Renamed System / Serv impacted" = Table.RenameColumns(#"Extracted Text After Delimiter",{{"Text Before Delimiter", "System / Serv impacted"}}),
#"Replaced Value Test" = Table.ReplaceValue(#"Renamed System / Serv impacted”,each [System / Serv impacted],each Text.Select([System / Serv impacted],{"0".."9","a".."z","A".."Z"," "}),Replacer.ReplaceText,{"System / Serv impacted"})
in
#"Replaced Value Test"

 

Any further suggestions would be amazing. 

Since you have a / in your column name, you need to refer it everywhere as

[#"System / Serv impacted"]

Thankyou so much Vijay. Worked a treat. Brilliant!!!

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors