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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Split text string

Hi,

 

I need to split my data in the format below. Remove data after dash but since the data format is different in all rows, search function isn't working. Can someone help please. 

 

Thanks.

 

BeforeAfter
A00034A00034
012302-00112302
012302-00212302
102538-001102538
102538-002102538
0928abc-010928abc
0928abc-020928abc
1856XYZ541856XYZ54
1 ACCEPTED SOLUTION

If you want to keep your original Coloumn you can also use this Dax formula.

After = IFERROR(
    MID(Table1[Before];1;SEARCH("-";Table1[Before])-1);
    Table1[Before])

 

After.PNG

 

 

have a great weekend. 🙂

View solution in original post

4 REPLIES 4
Thim
Resolver V
Resolver V

Go into Quiry Editor

Right click on the column and choose "split column" and "by delimiter"

 

Choose Custom, and put the sign -

This will put all data past the - in a new colunm, and entirely remove the -

then you can just remove the "new" column.

 

Split.PNGRemove.PNG

 

Hope the will help. 🙂

 

 

If you want to keep your original Coloumn you can also use this Dax formula.

After = IFERROR(
    MID(Table1[Before];1;SEARCH("-";Table1[Before])-1);
    Table1[Before])

 

After.PNG

 

 

have a great weekend. 🙂

Anonymous
Not applicable

 

@Thim

 

Wow! That worked. 

 

Thanks for the help! 🙂

Anonymous
Not applicable

Need further help!

 

I have a database as below and need to populate my client status as new or old. A client is considered as new if the 'date' and 'live date' are same. For rows 2 and 3, client is same however it has a new deal marked as -002.  client 12303 is counted twice for data source B. I need to populate the second row as blank as it has already be counted once in row 2.

 

A client is considered as new if the 'date' and 'live date' are same. client 12303 is counted twice for data source B. 

 

 

Apologies for too many complications.

 

Data sourcedateLive dateDeal IDClient IDStatus I am gettingREQUIRED STATUS
A26-Oct01-SepA00034A00034oldold
B15-Oct15-Oct012302-00112302newnew
B26-Oct26-Oct012302-00212302new(blank)
A01-Sep01-sep102538-001102538newnew
A26-Oct26-oct102538-002102538

new

(blank)
B26-Oct01-Sep0928abc-010928abcoldold
B26-Oct01-Sep0928abc-020928abcoldold
A01-Sep01-Sep1856XYZ541856XYZ54newnew

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.