cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThiagoDuarte
Frequent Visitor

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
Super User II
Super User II

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
Super User II
Super User II

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

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
Solution Sage
Solution Sage

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
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors