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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
alfredorhz
Helper I
Helper I

Extract text from string

HI Community
I have a string, that I get from a PowerShell script, This script creates a report from SharePoint page views, so, in the context of the information the audit data has a very large string.
I need extract some parts of the string but I need a search all registers that start with "http" and finish ".aspx" or ".pdf" words

this is the example register that I need to extract

alfredorhz_0-1694045387653.png

The delimiter by default ( point, comma, quotes, etc) doesn't work, this is because some operations, types, or audit data change in size even in localization


Thanks for the help

1 ACCEPTED SOLUTION
alfredorhz
Helper I
Helper I

Thanks guys

I resolve this with a dax,

Extract =
var fin = LEFT(Table[AuditLog], SEARCH("http",Table[AuditLog])-1)
var Lentf = LEN(fin)
var Midd = MID(Table[AuditLog], Lentf, 250)
#This is a delimiter before .aspx or .pdf acces file
var
http = SEARCH(",", Midd)
return
LEFT(Midd, http)

View solution in original post

7 REPLIES 7
alfredorhz
Helper I
Helper I

Thanks guys

I resolve this with a dax,

Extract =
var fin = LEFT(Table[AuditLog], SEARCH("http",Table[AuditLog])-1)
var Lentf = LEN(fin)
var Midd = MID(Table[AuditLog], Lentf, 250)
#This is a delimiter before .aspx or .pdf acces file
var
http = SEARCH(",", Midd)
return
LEFT(Midd, http)
Ahmedx
Super User
Super User

the whole file is not needed, you create a few examples and paste the court

christinepayton
Super User
Super User

This looks like JSON maybe? There is a "parse JSON" button in the toolbar in Power Query, if you use that on the field it will let you expand out specific parts as columns without needing to split on characters. 

Hi Chirstine
thanks

Its a colum of an power shell extraction report, its a csv file

alfredorhz_0-1694104940851.png

I tried split columns before, but the process splits a lot of columns, I was looking for a specific solution

The file is CSV but the text in that column looks like JSON - did you try the parse JSON button with that column selected? I have done this with CSV exports from the audit logs personally, so it does work. Parse and then expand out the fields you want into new columns.

christinepayton_0-1694118618847.png

 

Ahmedx
Super User
Super User

Share sample pbix file to help you.

Hi Ahmedx
Thanks
It´s a little dificult share this files, you know, company sharing restrictions

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors