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

View all the Fabric Data Days sessions on demand. View schedule

Reply

How do I get only the text before the last delimitter?

My scenario is that I have a column named 'Path' which contains the Path to a list of files. I need a custom column which only includes the text before the last delimitter. For example,

 

Full Path:

\\SERVER\FOLDER1\FOLDER2\FOLDER3\Excel.XLSX

Folder Path:

\\SERVER\FOLDER1\FOLDER2\FOLDER3\

 

There is going to be many different variations of this, so I can't just stick to one number, but it will always be before the last one. 

 

I've tried messing around with the 'Extract' function but can't get it to work. Any ideas how to put this into a 'Cutom Column'?

 

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @dinosainsburys - you can create a Custom Column in Power Query using the custom column add the below formaule given. 

Text.BeforeDelimiter([Path], "\", {0, RelativePosition.FromEnd})

 

 

rajendraongole1_0-1733744943576.png

 

 

Hope this works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

danextian
Super User
Super User

Hi @dinosainsburys 

Please see the screenshot below:

danextian_1-1733745138800.png

 

You can either transform the curent column or add a new one.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @dinosainsburys ,
It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered? If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!

danextian
Super User
Super User

Hi @dinosainsburys 

Please see the screenshot below:

danextian_1-1733745138800.png

 

You can either transform the curent column or add a new one.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
rajendraongole1
Super User
Super User

Hi @dinosainsburys - you can create a Custom Column in Power Query using the custom column add the below formaule given. 

Text.BeforeDelimiter([Path], "\", {0, RelativePosition.FromEnd})

 

 

rajendraongole1_0-1733744943576.png

 

 

Hope this works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Sorry, I should have specified a bit better. How do I remove any of the text between the delimiters?

 

For example, 

where I have this:

 

\\SERVER\FOLDER1\FOLDER2\FOLDER3\

 

that would imply it is in FOLDER2

 

so it should display something like this:

\\SERVER\FOLDER1\FOLDER2\

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors