Forum Discussion
Split column as per specific condition
This is my data:
I want this result:
- Explanation :
When Y= no bgm then X column split as per result(2nd photo), only split by one character, where the last character is "B" or "Y"
Hi MHTANK
In Power Query, create a custom column and paste the below code= if [Y]="no bgm" then Text.Start([X],1) else [X]
If your requirement is solved, please make sure to MARK AS SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.
Thanks
Pijush
4 Replies
- PijushRoyCommunity Champion
Hi MHTANK
In Power Query, create a custom column and paste the below code= if [Y]="no bgm" then Text.Start([X],1) else [X]
If your requirement is solved, please make sure to MARK AS SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.
Thanks
Pijush- MHTANKHelper III
Oh, it's very easy, thank you so much 👍🏻
- PijushRoyCommunity Champion
Hi MHTANK
With DAX, create a calculated column and paste the codeZ = IF('Table'[Y]="no bgm",LEFT('Table'[X],1),'Table'[X])
If your requirement is solved, please make sure to MARK AS SOLUTION ✔️ and help other users find the solution quickly. Please hit the LIKE 👍 button if this comment helps you.
Thanks
Pijush