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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors