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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
BobbyG
New Member

Converting Nested Excel Text Function to Power Query (M)

Hi,

 

I'm trying to extract text of various lengths within string based on the position of certain operators within a string. 

 

The current excel formula i'm using to do this is as follows: =TRIM(MID(A2,FIND("Text1",A2)+11,IFERROR(FIND("|",A2,FIND("Text1",A2)),LEN(A2))-FIND("Text1",A2)-IF(OR(FIND("Text1",A2)=1,LEN(A2)-LEN(SUBSTITUTE(A2,"|",""))>=2),11,9)))

 

 

Trying to recreate this using various Text functions (Range, PositionOf, etc.) but having some trouble, espescially when it comes to the last if or section

1 REPLY 1
Interkoubess
Solution Sage
Solution Sage

Hi @BobbyG,

 

Could you please share dummy data ( some examples ) and I will make a try.

 

Ninter

 

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.