Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
unnijoy
Post Prodigy
Post Prodigy

Extracting text before a delimiter

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 .

1 ACCEPTED 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 . 

 

vkkfmsft_0-1627260733326.png

 

Try the following formula:

 

Name = 
LEFT(
    'Table'[Name & ID],
    SEARCH(
        "(", 
        'Table'[Name & ID],
        ,
        LEN('Table'[Name & ID]) + 1
    ) - 1
)

vkkfmsft_1-1627261556828.png

 

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.

 

View solution in original post

6 REPLIES 6
Nikita_Arora
New Member

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

Nikita_Arora_1-1659004283601.png

 

it's working fine without using variable but showing error once i'm trying to optimise this dax using variables




amitchandak
Super User
Super User

@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)

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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 . 

 

vkkfmsft_0-1627260733326.png

 

Try the following formula:

 

Name = 
LEFT(
    'Table'[Name & ID],
    SEARCH(
        "(", 
        'Table'[Name & ID],
        ,
        LEN('Table'[Name & ID]) + 1
    ) - 1
)

vkkfmsft_1-1627261556828.png

 

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)

@v-kkf-msft ,

 

Thanks a Lot for your help 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.