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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors