cancel
Showing results for 
Search instead for 
Did you mean: 
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 Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

Power BI Dev Camp Session 22 with aka link 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!