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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
aury_lola
Regular Visitor

Power Query: Extract string from one column based on another column in the same table

Hi everyone,

 

I have a table with 2 columns where one is the combination of the other one plus some characters. As you can see in the image below, neither the "Prefix" nor the characters I'm trying to isolate follow any kind of logic in terms of number of characters, delimiter, etc. I only know that "Combination" = "Prefix" + something.

 

Screenshot 2025-01-09 093550.jpg

 

 

 

 

 

 

 

 

 

 

 

How can I isolate that something extra (in yellow above) either in the same column or as a custom column?

I can't use the extract or the split by delimiter functions because of the lack of logic. And this table comes from a source that I cannot edit it, but I still need to find a way to isolate that something extra.

 

Ideally I'd like to do it in power query, but I could make it work in DAX as well if the first is not possible.

 

Thank you advance for any help!

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@aury_lola 

is this what you want?

 

=Text.End([Combination],Text.Length([Combination])-Text.Length([Prefix]))

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@aury_lola 

is this what you want?

 

=Text.End([Combination],Text.Length([Combination])-Text.Length([Prefix]))

11.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




That's exactly what I was looking for! Thank you very much!

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




lbendlin
Super User
Super User

Use Text.StartsWith - PowerQuery M | Microsoft Learn  to check if the second column value starts with the first column value.  Then use Text.Range - PowerQuery M | Microsoft Learn to return the rest of the second string.

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.