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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
RamiDaoud
Frequent Visitor

Remove White Spaces between decimal digits

Hello, I have Latitude column with Decimal type and there are some spaces between the digits. My question is how I can remove the spaces? .  I tried trim function which required changing the type from Decimal to Text and when I changed the type I have strange values.

The following explain the case: Thank 

Latitude(Current)Latitude (After cleaning)
32.  5674432.56744
  32. 56 47232.56472
3 2.1  2   36032.12360
  
8 REPLIES 8
Icey
Community Support
Community Support

Hi @RamiDaoud ,

 

Is this problem solved?

 

If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If not, please share us a dummy .pbix file with the same issue. Please remove real data and sensitive information.

 

 

Best Regards,

Icey

Hello,

Unfortunatly, the problem has not been solved yet. I will share the file soon. 

Thanks,

@RamiDaoud , as @Jimmy801 mentioned, embedded Text.From() function will do the trick,

Table.AddColumn(Source, "Custom", each Text.Remove(Text.From([Latitude]), " "))

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

CNENFRNL
Community Champion
Community Champion

Hi, @RamiDaoud , Text.Remove does the trick for you.

Table.AddColumn(Source, "Custom", each Text.Remove([Latitude], " "))

Screenshot 2021-01-02 103703.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

I tried it but I recived the follwoing error: 

Expression.Error: The value isn't a single-character string.

Thank you

Hello @RamiDaoud 

 

are you sure the second parameter is a " " and not a string with 2 characters?

 

BR

 

Jimmy

Thank you for your comment I modified it based on your comment. However, I recived the following error:

 

Expression.Error: We cannot convert the value 32.346477999999998 to type Text.
Details:
Value=32.346478
Type=[Type]

Hello

Then surround your column reference with Text.From()

 

Br jimmy

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.