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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LillyD
Frequent Visitor

Extracting a specific phrase to a new cell from a large amount of text

Hi,

 

I am trying to exctract a specific phrase from one cell that contains a large amount of information, to a new cell / column.  I need to do this so I can isolate the corruption information from the rest of the information, any one got any ideas please?

 

Example given below, I would like to return just the all the items in the red box, these appear for mulitple users with mulitple locations but what seems to the standard is the "A corrupted item was encountered:"

 

Thanks in advance

error1.PNG

 

1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

with the whole string in one cell it is a bit diffficult
I would do it in M, with following logic:
1) split that text into multiple rows,
2) split that into multiple columns: time stamp, whatever is in the brackets, and then actual message
3) create a dictionary of error messages that have to be searched for (unless you're sure that "A corrupted item was encountered:" is the only error you may get
4) create a flag indicating if the rows from 1) contain one of the errors
5) filter only error rows and remove duplicates to limit the data (unless multiple time stamps are relevant for this)



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

3 REPLIES 3
ImkeF
Super User
Super User

I believe adding a column with extracting everything after the delimiter would work here as well:

 

image.png

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Stachu
Community Champion
Community Champion

with the whole string in one cell it is a bit diffficult
I would do it in M, with following logic:
1) split that text into multiple rows,
2) split that into multiple columns: time stamp, whatever is in the brackets, and then actual message
3) create a dictionary of error messages that have to be searched for (unless you're sure that "A corrupted item was encountered:" is the only error you may get
4) create a flag indicating if the rows from 1) contain one of the errors
5) filter only error rows and remove duplicates to limit the data (unless multiple time stamps are relevant for this)



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

LillyD
Frequent Visitor

Thank you 🙂 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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