Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a column ( Name & ID) that contain name and employee ID. i need to extract only the name using a dax.
for example the name is Mathew V James (12345).
Now i need to get the text as Mathew V James.
The Name & ID column is a calculated column. And i don't want to make any change in that column.
Please help me with a measure that i need to use on a visula .
Solved! Go to Solution.
Hi @unnijoy ,
Does your Name & ID column contain data like "AA" without parentheses? If so, you will get an error when using the DAX provided by @amitchandak .
Try the following formula:
Name =
LEFT(
'Table'[Name & ID],
SEARCH(
"(",
'Table'[Name & ID],
,
LEN('Table'[Name & ID]) + 1
) - 1
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-kkf-msft ,
I'm Facing the same isssue if i try to fix FIND function then i usually get RIGHT function error . Here is the screenshot for your reference
it's working fine without using variable but showing error once i'm trying to optimise this dax using variables
@unnijoy , You need to have a new column for that. Best is split this in power query based on (
In dax a new column
left([name], search("(", [Name],,0)-1)
hi @amitchandak ,
An argument of function 'LEFT' has the wrong data type or has an invalid value. this is the error message that i am getting. I check the column type. Its in Text.
Hi @unnijoy ,
Does your Name & ID column contain data like "AA" without parentheses? If so, you will get an error when using the DAX provided by @amitchandak .
Try the following formula:
Name =
LEFT(
'Table'[Name & ID],
SEARCH(
"(",
'Table'[Name & ID],
,
LEN('Table'[Name & ID]) + 1
) - 1
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
NAME = LEFT('Table'[Name & ID],SEARCH("(",'Customer Data'[Customer Name],1,0)-1)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |