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

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.

Reply
ThiagoDuarte
Helper I
Helper I

Extract text between delimiters based on other column value (position)

Hello,

 

I need to extract a text between delimiter ( "," ) based on the second cloumn value. The text between delimiter may have any lenght.

 

The second column has the position value for the substring in the first column

 

Data:

ThiagoDuarte_0-1620852881466.png

 

I want to create a third column that should be:

 

Q2.7X2.7X0.4 (Second value from rci_optioncombo = position 1)

Não aplicável

NÃO

Não se aplica

Pêra Horizontal

 

I'm using Direct Query

 

I hope you guys can help me!

 

Thanks

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hi @ThiagoDuarte ,

with DAX you can do it like this:

 

13-05-_2021_01-30-56.png

 

Extracted = PATHITEM(SUBSTITUTE(MIN('Table'[rc_optionscombo]),",","|"),MIN('Table'[rci_measured]))

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

3 REPLIES 3
FrankAT
Community Champion
Community Champion

Hi @ThiagoDuarte ,

with DAX you can do it like this:

 

13-05-_2021_01-30-56.png

 

Extracted = PATHITEM(SUBSTITUTE(MIN('Table'[rc_optionscombo]),",","|"),MIN('Table'[rci_measured]))

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

It worked!

 

I had to add a +1 after calling the second column to get it to work properly here

Extracted = PATHITEM(SUBSTITUTE(MIN('Table'[rc_optionscombo]),",","|"),MIN('Table'[rci_measured])+1)

 

Thank you!

samdthompson
Memorable Member
Memorable Member

Hello, this is best done in power query:

 

Home>>>Split Column>>>By Delimiter

 

 

// if this is a solution please mark as such. Kudos always appreciated.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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