Forum Discussion
Anonymous
4 years agoNot applicable
Trim a string before a character
Hi Experts, I have a column which have a string as the below. I want to have a DAX formula to truncate the text on the first Semi-Colon ":" Rohde & Schwarz GmbH & Co. KG: Q42 FY22 MaintRenew...
- 4 years ago
Hi Anonymous
Try this code to add a new column:
Column = Var _SR = SEARCH(":",'Table'[Data]) return left('Table'[Data],len('Table'[Data])-_SR-2)or this code to add a new measure:
measure= Var _SR = SEARCH(":",max('Table'[Data])) return left(max('Table'[Data]),len(max('Table'[Data]))-_SR-2)If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
VahidDM
4 years agoSuper User
Hi Anonymous
Try this code to add a new column:
Column =
Var _SR = SEARCH(":",'Table'[Data])
return
left('Table'[Data],len('Table'[Data])-_SR-2)
or this code to add a new measure:
measure=
Var _SR = SEARCH(":",max('Table'[Data]))
return
left(max('Table'[Data]),len(max('Table'[Data]))-_SR-2)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/