Forum Discussion
Remove text in one column based on another column
- 9 years ago
This is a nice example for the new Text,BetweenDelimiters function that was introduced with the April 2017 Update of Power BI Desktop.
You can add a column with the following formula:
Text.Trim(Text.BetweenDelimiters([Version]," ",[Software],{1,RelativePosition.FromEnd},{0,RelativePosition.FromEnd}))It will look for the the second space from the end and then - in the preceding part of the string - to the first [Software] string from the end, and returns the part in between.
I created a 14 minute video about the new Text.AfterDelimiter, Text,BeforeDelimiter and Text.BetweenDelimiters functions.
This is a nice example for the new Text,BetweenDelimiters function that was introduced with the April 2017 Update of Power BI Desktop.
You can add a column with the following formula:
Text.Trim(Text.BetweenDelimiters([Version]," ",[Software],{1,RelativePosition.FromEnd},{0,RelativePosition.FromEnd}))
It will look for the the second space from the end and then - in the preceding part of the string - to the first [Software] string from the end, and returns the part in between.
I created a 14 minute video about the new Text.AfterDelimiter, Text,BeforeDelimiter and Text.BetweenDelimiters functions.
Following up on this example...
What if I wanted to remove text from a string in one column based on the text in another column using functions, when there is no other clear delineation such as a space?
Using JChris's original data as an example: What if I wanted to remove the CarName text from the Year column based on it appearing in the CarName column? Is there a programmatic way to do that, or would it require a clear delimiter such as a space, a hyphen, etc.?