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

The Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

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.