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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Search from right to left

Hi all,

 

here is the problem I'm trying to solve:

I have a column with text looks like this 

 

Campaign1_IG_feed_bumper
Campaign2_IG_feed_10sec

Campaign3_PIN_VideoPin_V2_6sec

 

I need to extract the text after lest "_". So, i need to have a columns with

bumper

10sec

6sec

 

I could use Find / Serach function but they both look from left to right and I get as result the position of first "_". Number of "_" could be different as well. So, I need to search from right to left and find a position of the first "_" from the right.

 

Any ideas how I can do that?

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can do it with Split Column by Delimiter in Power Query as per below.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

In the edit query mode you can use M code

Text.PositionOf(Table[Column], "_", Occurrence.Last)

https://docs.microsoft.com/en-us/powerquery-m/text-positionof

Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

You can do it with Split Column by Delimiter in Power Query as per below.

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

Thanks a lot! I didn't think about the query. It works!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.