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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PhilippeMuniesa
Resolver I
Resolver I

Text.TrimEnd Replace I can't remove spaces from a column

Hello,

 

I am getting bank statements, and I want to remove all spaces from the label column .... I tried TrimEnd,..

 

Text.TrimEnd([Libellé])

 

I tried ReplaceValue 

 

Table.ReplaceValue(AjLibellé,""" ""","",Replacer.ReplaceText,{"Libellé"})

 

I cannot get rid of the spaces, however, once in Excel, the function replace "" by nothing, works correctly.

 

Attached is a Dropbox link of a  folder that contains

 

https://www.dropbox.com/sh/s5my4tqfwlc3bpt/AAD9AHUu6rHyE_X_EgJrM82Xa?dl=0

 

An example of a recovered CSV file,

a CsvToXLViaPQ folder which contains the Excel file with the PQ request

 

The relevant query under development is called CC

 

Thank you in advance for any help you can give me

 

Philippe Muniesa

2 ACCEPTED SOLUTIONS
BA_Pete
Super User
Super User

Hi @PhilippeMuniesa ,

 

Your M code should look like this:

Table.ReplaceValue(AjLibelle," ","",Replacer.ReplaceText,{"Libelle"})

 

Pete 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

Anonymous
Not applicable

 

If you are trying to accomplish this, you need to use the syntax you see in the image

 

image.png

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

 

If you are trying to accomplish this, you need to use the syntax you see in the image

 

image.png

 

 

BA_Pete
Super User
Super User

Hi @PhilippeMuniesa ,

 

Your M code should look like this:

Table.ReplaceValue(AjLibelle," ","",Replacer.ReplaceText,{"Libelle"})

 

Pete 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




thank you,

 

it is indeed the double quote that causes the problem, however it is the interface of the powerquery editor of excel which offers this syntax.

I ended up bypassing the problem with Text.FromNumber (32),

 

thank you very much for your two answers

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.