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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Syndicate_Admin
Administrator
Administrator

Help white spaces at the end

Good afternoon everyone, I need your help because I have a problem with the blanks at the end of a text.

In the query editor in the column "Client" there are values that have a space at the end as you can see in the screenshot (Ej Acosta Andres Daniel .

flit_0-1656014775296.png

After clicking "close and apply" and go to the data, the space disappears:

flit_1-1656014953829.png

In the capture above you can not appreciate, but the space in the end disappeared! This becomes visible when I copy the data to an Excel.

Could someone help me how to make sure this doesn't happen?

Thank you!

Fred

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Syndicate_Admin ,

 

I create a sample to have a test and I can reproduce your result. The trailing spaces will disappear in data view after we click "Close & Apply".

As far as I know, when strings are imported into AS Engine, the trailing spaces are trimmed. So the disappearing of the trailing spaces is by design. Here I suggest you to replace the trailing spaces by other characters like "_".

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
otravers
Community Champion
Community Champion

Trim this column (Transform > Format in the ribbon):

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

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals

Thanks for the help! In this case I need the space not to disappear so the Text.trim function would not be useful for this case.

Best regards

Anonymous
Not applicable

Hi @Syndicate_Admin ,

 

I create a sample to have a test and I can reproduce your result. The trailing spaces will disappear in data view after we click "Close & Apply".

As far as I know, when strings are imported into AS Engine, the trailing spaces are trimmed. So the disappearing of the trailing spaces is by design. Here I suggest you to replace the trailing spaces by other characters like "_".

 

Best Regards,
Rico Zhou

 

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

Hi @Anonymous ,

I have a similar requirement where I've included all the special characters in a Calculated Column. Could you please assist me? I've also posted a similar query in the forum.

Can you guide me on how to replace white spaces with specific special characters?

https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-Solutions-for-Trailing-Space-Trimming-Issue-in-Power-Query/m-p/3673619#M142545

Thank you.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.