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
young351
Frequent Visitor

Removing certain number of characters in the middle of a value string

I need to remove a certain set of numbers that fall in the middle of a value string.  I need my results to be 8-BL-HOT OIL and 5-BL-HOT OIL:

young351_0-1631804739720.png

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @young351 ,


According to your description, you can now use the Extract function in power query, and then merge the two columns in powerbi desktop. I did a test, the reference is as follows:

vhenrykmstf_0-1632118641597.png

Column = 'Table (3)'[First Characters] & 'Table (3)'[Last Characters]

vhenrykmstf_1-1632118852056.png

 


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @young351 ,


According to your description, you can now use the Extract function in power query, and then merge the two columns in powerbi desktop. I did a test, the reference is as follows:

vhenrykmstf_0-1632118641597.png

Column = 'Table (3)'[First Characters] & 'Table (3)'[Last Characters]

vhenrykmstf_1-1632118852056.png

 


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

Best Regards,
Henry


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

Use the Text.Start() and Text.End() functions in Power Query to concatenate the first character and the 10 last characters of your string.

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.