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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
ovetteabejuela
Impactful Individual
Impactful Individual

Power Query | Remove last word

Hi Guys & M-Gurus,

 

How would you remove the last word in a text, actually in my case I'm trying to remove middle names which are placed at the end portion of the name:

 

<First Name>, <Last Name> <Middle Name>

 

How do you remove the <Middle Name>.

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@ovetteabejuela

 

Hi, try with AddColumn-Extract :

 

Delimiter =  (Space)

 

Regards

 

Victor

 

img1.png




Lima - Peru

View solution in original post

4 REPLIES 4
janepettigrew
New Member

Thank you for this solution, however I am hoping to find out how to do this when there are multiple words, and several space delimiters in a field. I need to remove the last word only.

 

Using the Contoso sales data as an example, all the products have the colour at the end of the Product Name field. I am looking to remove the colour and leave the product name only in the column, but the product names consist of several words. There are numerous spaces in each name, but the colour is only ever the last word of the field.  I am new to DAX and Power BI, but not new to Excel and text functions. 

 

Thanks in advance.

 

janepettigrew
New Member

Thank you for this solution, however I am hoping to find out how to do this when there are multiple words, and several space delimiters in a field. I need to remove the last word only.

 

Using the Contoso sales data as an example, all the products have the colour at the end of the Product Name field. I am looking to remove the colour and leave the product name only in the column, but the product names consist of several words. There are numerous spaces in each name, but the colour is only ever the last word of the field.  I am new to DAX and Power BI, but not new to Excel and text functions. 

 

Thanks in advance.

 

Vvelarde
Community Champion
Community Champion

@ovetteabejuela

 

Hi, try with AddColumn-Extract :

 

Delimiter =  (Space)

 

Regards

 

Victor

 

img1.png




Lima - Peru

Thanks @Vvelarde, +1 to my learning and I won't forget that, it's already etched in my mind coz I need to.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.