Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 "HOUSTON, TX". Here is the DAX I am trying to use, but am getting an error regarding Type Text to Type Number:
Trimmed Work Loc = left('All Current Employees'[Work Location],LEN('All Current Employees'[Work Location]-5))
Any ideas? Thanks.
Solved! Go to Solution.
Your parens just aren't lined up right.
Trimmed Work Loc = left('All Current Employees'[Work Location],LEN('All Current Employees'[Work Location])-5)
Your parens just aren't lined up right.
Trimmed Work Loc = left('All Current Employees'[Work Location],LEN('All Current Employees'[Work Location])-5)
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?
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!
User | Count |
---|---|
98 | |
76 | |
74 | |
49 | |
26 |