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
Anton-G
Helper I
Helper I

Remove spaces without creating a new column

Hello

 

Want to get a text string without spaces.

 

Is connected to a "SQL Server Analysis Services Database" in Power BI sometimes the information is with spaces and sometimes without.

As an example 'Item'[Type] can be:

09 000 5227

09 000 5228

090005229

 

The example I have found is to create add new column but since I am connected to a database I do not have access to add a new column.

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anton-G 

You can use replace method to replace a space with nothing if you are using Import mode with AS.

Vpazhenmsft_0-1635736371222.png

 


If you are using live connection mode with AS, there is no way to do so. You must try find a way to remove the space in AS before connecting to Power BI. Because live connection mode retrieves the entire AS model, you cannot access query editor to change the content, also dax is used to create new fields not to change existing column with dax.  Hope that is clear.

 

 

Best Regards

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@Anton-G 

You can use replace method to replace a space with nothing if you are using Import mode with AS.

Vpazhenmsft_0-1635736371222.png

 


If you are using live connection mode with AS, there is no way to do so. You must try find a way to remove the space in AS before connecting to Power BI. Because live connection mode retrieves the entire AS model, you cannot access query editor to change the content, also dax is used to create new fields not to change existing column with dax.  Hope that is clear.

 

 

Best Regards

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Samarth_18
Community Champion
Community Champion

Hi @Anton-G ,

 

You can create a measure with code:-

 

Measure =
SUBSTITUTE ( MAX ( 'Table'[column1] ), " ", "" )

Output:-

Samarth_18_0-1635339040214.png

Thanks,

Samarth

 

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Greg_Deckler
Community Champion
Community Champion

@Anton-G Right-click the column in Power Query Editor. Choose Replace values. Replace space with nothing.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.

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.