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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
jeongkim
Post Prodigy
Post Prodigy

Get values with delimiter in DAX

Hi,

 

Can I get only number in the middle after delimiter "-" and before delimiter "/"? 

 e.g.  Result should be 113960

 

Hope the solution will not be with Left or Mid fucntion since there will be changes on number of text. 

 

 

jeongkim_0-1750834324138.png

 

1 ACCEPTED SOLUTION
freginier
Solution Sage
Solution Sage

Hi, 

 

You can extract the number using PATHITEM with SUBSTITUTE, which avoids using LEFT or MID:

 

 

PATHITEM(SUBSTITUTE(SUBSTITUTE('Table'[INVUNIT], "-", "|"), "/", "|"),3)

 

 

Replace "-" and "/" with a common delimiter like "|"

Then use PATHITEM(..., 3) to get the 3rd element (i.e. the number after - and before /)

This is dynamic and doesn’t depend on string length.

 

freginier

View solution in original post

1 REPLY 1
freginier
Solution Sage
Solution Sage

Hi, 

 

You can extract the number using PATHITEM with SUBSTITUTE, which avoids using LEFT or MID:

 

 

PATHITEM(SUBSTITUTE(SUBSTITUTE('Table'[INVUNIT], "-", "|"), "/", "|"),3)

 

 

Replace "-" and "/" with a common delimiter like "|"

Then use PATHITEM(..., 3) to get the 3rd element (i.e. the number after - and before /)

This is dynamic and doesn’t depend on string length.

 

freginier

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.