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

Removing a sapce/letter from a column (only first letter)

PowerBI help screenshot.png

Good day!

 

I have a problem with removing a space(letter) when transforming my data. I had to split a column via a comma that was between answers from a multiple answer question. Depending on the order and selection participants made the order of the answer was different but all came together in 1 column. However, upon splitting the natural wya is that the first option is in the first column, then the first split sending the 2nd answer to another column - no problem there.

 

However, all the splitted answers have a space in front of them compared ti the first column (the first answer made by participants) has none. Therefore, PowerBi reads it as seperate answers. 
Do you know how a small space can be removed from a column in a easy and quick way?
(Replace value would be perfect if I could select "Only first letter"). 

Thank you!

1 ACCEPTED SOLUTION
manikumar34
Solution Sage
Solution Sage

@Anonymous , 

To remove whitespaces before and after the text use trim function from format in query editor.

manikumar34_2-1606581136882.png

 

Or add a step in advanced editor like this. 

= Table.TransformColumns(Source,{{"Column", Text.Trim, type text}})

 

Regards, 

Manikumar

 

If this is helpful, Accept as a Solution and leave a like.

 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

Can you provide sample data and the expected results in text format to come out with a suitable solution?

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

manikumar34
Solution Sage
Solution Sage

@Anonymous , 

To remove whitespaces before and after the text use trim function from format in query editor.

manikumar34_2-1606581136882.png

 

Or add a step in advanced editor like this. 

= Table.TransformColumns(Source,{{"Column", Text.Trim, type text}})

 

Regards, 

Manikumar

 

If this is helpful, Accept as a Solution and leave a like.

 





If this helps, Appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




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.