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 August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Split text to column by text without delimiter

hi,

I have the text string as below from html table.

It has no delimiter, please help me to extrac them into columns as below:

 

Problem:

Contract: ABCLocation: USADate Start: 2020Date End: 2021Requester: Mr SmithCode: 01

Contract: XYZLocation: AmerciaSDate Start: 01/07/2019Date End: 01/01/2022Requester: Jim BoCode: 0100

 

Required solution:

Contract Requester Location
ABC        Mr Smith  USA
XYZ        Jim Bo       Amercia

I have tried this solution but my dax knowledge is limited and cant make it works.

https://community.powerbi.com/t5/Desktop/Split-column-in-multiple-columns-based-on-text/m-p/2034418#...

 

thanks in advance.

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try these DAX columns:

Contract = 
    VAR __Start = SEARCH(" ",[Column]) + 1
    VAR __End = SEARCH("Location:",[Column])
RETURN
    MID([Column],__Start,__End - __Start)


Requestor = 
    VAR __Start = SEARCH("Requester: ",[Column]) + LEN("Requester: ")
    VAR __End = SEARCH("Code:",[Column])
RETURN
    MID([Column],__Start,__End - __Start)


Location = 
    VAR __Start = SEARCH("Location: ",[Column]) + LEN("Location: ")
    VAR __End = SEARCH("Date Start:",[Column])
RETURN
    MID([Column],__Start,__End - __Start)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try these DAX columns:

Contract = 
    VAR __Start = SEARCH(" ",[Column]) + 1
    VAR __End = SEARCH("Location:",[Column])
RETURN
    MID([Column],__Start,__End - __Start)


Requestor = 
    VAR __Start = SEARCH("Requester: ",[Column]) + LEN("Requester: ")
    VAR __End = SEARCH("Code:",[Column])
RETURN
    MID([Column],__Start,__End - __Start)


Location = 
    VAR __Start = SEARCH("Location: ",[Column]) + LEN("Location: ")
    VAR __End = SEARCH("Date Start:",[Column])
RETURN
    MID([Column],__Start,__End - __Start)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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