Forum Discussion
jsabo
9 years agoHelper I
Help with DAX to Trim
Hello, I am trying to trim 4 characters off the back of a field. For instance, the field might contain "HOUSTON, TX (42H)" and I would like to have a custom column which will contain only "HOUSTO...
- Anonymous9 years ago
Your parens just aren't lined up right.
Trimmed Work Loc = left('All Current Employees'[Work Location],LEN('All Current Employees'[Work Location])-5)
jsabo
9 years agoHelper I
Thanks, Anonymous. Now I get an error stating, "An argument of function 'LEFT' has the wrong data type or has an invalid value".
There will be times that there are blanks, I don't know if that's the issue here?
jsabo
9 years agoHelper I
Got it, just used this:
Trimmed Work Loc = if('All Current Employees'[Work Location] ="", "",left('All Current Employees'[Work Location],LEN('All Current Employees'[Work Location])-5))
thanks, Anonymous!