The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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:
Title | Quantity |
Example A | 1 |
Example C | 1 |
Example A | 1 |
Example B | 3 |
Example C | 7 |
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!!!!!!!!!!!!!!!!!!!!!!!!!
Solved! Go to Solution.
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"})
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!!!