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
deepak91g
Resolver II
Resolver II

Split (left) a text column based on '-' or '_' as Delimiter?

 

I would like to achieve this task. I tried using split columns http://prntscr.com/ibe7hy

InputOutput
A_BA
AB_CAB
AC-DAC
ABC-E_CABC
AC_E-DAC
3 ACCEPTED SOLUTIONS
gooranga1
Power Participant
Power Participant

You could also use a formula like;

 

Column x = left(SUBSTITUTE(Table6[Column1],"-","_"),FIND("_", SUBSTITUTE(Table6[Column1],"-","_"),1,LEN(SUBSTITUTE(Table6[Column1],"-","_"))+1)-1)able6[Column1],"-","_"))+1)-1)

splitter.PNG

View solution in original post

@gooranga1 Thanks for suggestion and giving an idea to approach this problem.

 

with some changes, this worked for me

 

left(SUBSTITUTE(ad_word_api_report_config[client_customer_name],"-","_"),FIND("_", SUBSTITUTE(ad_word_api_report_config[client_customer_name],"-","_"),1,LEN(SUBSTITUTE(ad_word_api_report_config[client_customer_name],"-","_"))+1)-1)

View solution in original post

Anonymous
Not applicable

@deepak91g

 

You can also use Splitter.SplitTextByAnyDelimiter({List of delimiters},Source)

 

list of delimiters can be {"&","/"}  

View solution in original post

7 REPLIES 7
marc_hav
Regular Visitor

Hi,

 

anyone an idea how I would go about this when one or more of the Inputs is simply A and Output should be A?

 

Thanks in advance!

Marc

 

gooranga1
Power Participant
Power Participant

You could also use a formula like;

 

Column x = left(SUBSTITUTE(Table6[Column1],"-","_"),FIND("_", SUBSTITUTE(Table6[Column1],"-","_"),1,LEN(SUBSTITUTE(Table6[Column1],"-","_"))+1)-1)able6[Column1],"-","_"))+1)-1)

splitter.PNG

Anonymous
Not applicable

@deepak91g

 

You can also use Splitter.SplitTextByAnyDelimiter({List of delimiters},Source)

 

list of delimiters can be {"&","/"}  

How do I get Splitter.SplitTextByAnyDelimiter to use only the first instance of the any delimiter?

@gooranga1 Thanks for suggestion and giving an idea to approach this problem.

 

with some changes, this worked for me

 

left(SUBSTITUTE(ad_word_api_report_config[client_customer_name],"-","_"),FIND("_", SUBSTITUTE(ad_word_api_report_config[client_customer_name],"-","_"),1,LEN(SUBSTITUTE(ad_word_api_report_config[client_customer_name],"-","_"))+1)-1)

Anonymous
Not applicable

@deepak91g

 

Hi, 

 

You can split column values by delimiter in Edit Queries and use split column function available. Hope this helps.Screenshot_4.png

Regards,

Shruti 

I have tried using split function but it didn't  work as I have multiple delimiter to first cols

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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