Forum Discussion
How to split column?
I have SAP BW on premise as my data source, I need to split a column the string goes like this: 10/10/GO11/P001
I need to extract out right most delimeter in this case is P001, now I could have easily done this using query editor, but problem is I cannot duplicate my column whenever I duplicate I get an error stating:
The field '[ZCUST_MA___F4].[LEVEL01].[2ZCUST_MA___F4]' already exists in the record.
Details:
So I cannot use the query editor here, is there any way I can write a DAX to split this one?
v-xuding-msft amitchandak Anonymous
Below post helped me in achieving the goal, thing was to create custom column using formulaText.Split([Value], ":"){2}and split the column according to the delimeter used with the {2} Position.
https://community.powerbi.com/t5/Desktop/DAX-extracting-string-using-delimiter/td-p/287840
6 Replies
- AnonymousNot applicable
Hi Anmolgan ,
you have to make two New Column by using below DAX formula:
First_Column = LEFT ( SUBSTITUTE ( Table1[Name], "/", "-" ), SEARCH ( "-", SUBSTITUTE ( Table1[Name], "/", "-" ) ) - 1 )Last name = RIGHT ( SUBSTITUTE ( Table1[Name], "/", "-" ), LEN ( SUBSTITUTE ( Table1[Name], "/", "-" ) ) - SEARCH ( "-", SUBSTITUTE ( Table1[Name], "/", "-" ) ) )Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
Regards,
Gaurav Raj Singh
LinkedIN : https://www.linkedin.com/in/gauravrajsingh/
- AnmolganPost Prodigy
Anonymous Substitute function is not helping me in this case, I dont want to replace my delimeter with - I need to extract out right most values after /
- v-xuding-msftCommunity Support
Hi Anmolgan ,
Please investigate the applied steps (panel on the right) and find the first erroneous step. You also could create a blank query to split the column and check if it works.
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnmolganPost Prodigy
Hi amitchandak as I stated earlier I tried this step only, but failed to duplicate column, as I have sent the error before, I need to do this using DAX custom column.
- AnmolganPost Prodigy
v-xuding-msft amitchandak Anonymous
Below post helped me in achieving the goal, thing was to create custom column using formulaText.Split([Value], ":"){2}and split the column according to the delimeter used with the {2} Position.
https://community.powerbi.com/t5/Desktop/DAX-extracting-string-using-delimiter/td-p/287840