Forum Discussion
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.
| Before | After |
| A00034 | A00034 |
| 012302-001 | 12302 |
| 012302-002 | 12302 |
| 102538-001 | 102538 |
| 102538-002 | 102538 |
| 0928abc-01 | 0928abc |
| 0928abc-02 | 0928abc |
| 1856XYZ54 | 1856XYZ54 |
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])have a great weekend. :-)
4 Replies
- ThimResolver 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.
Hope the will help. :-)
- ThimResolver V
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])have a great weekend. :-)
- AnonymousNot applicable