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 September 15. Request your voucher.

Reply
maxduff59
Helper II
Helper II

Convert text format 11,11 in decimal number

Hi everybody,

I am a newbie on PowerBi, and one of the first step I am trying to do is the data cleaning in the Power Query Editor. I have columns with number in a text format such as '58.67'. I cannot convert it to decimal directly (I have an error) so I decided to change the point by a coma such as '58,67'. After that when I convert it to decimal number format, I am having 5867 instead of 58,67.

Does somebody know how I could correct my mistake ?

Thanks in advance for your time

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @maxduff59 ,

 

It seems to work fine in my side:

vjianbolimsft_5-1659092301796.png

vjianbolimsft_6-1659092317013.png

Output:

vjianbolimsft_8-1659092360109.png

 

 

Here is the M code:

 

let

    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrXQMzNXitWJVjI31jMzBLMM9YwgDCM9cwswwxgirhQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),

    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type number}})

in

#"Changed Type"

 

 

Beasides, you can try :

vjianbolimsft_9-1659092398778.png

 

vjianbolimsft_3-1659092172114.png

Then keep the column you need

Output:

vjianbolimsft_4-1659092242856.png

Here is the M code:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrXQMTNXitWJVjI31jEzBLMMdYwgDCMdcwul2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each [Column1]/100),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"})
in
    #"Removed Other Columns"

 

Please provide me with more details about your data and your error or share me with your pbix file after removing sensitive data.

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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
Syndicate_Admin
Administrator
Administrator

I have the same inconvenience, text format values such as: "4,22" when converted to decimal number type converts it to "422".

v-jianboli-msft
Community Support
Community Support

Hi @maxduff59 ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

v-jianboli-msft
Community Support
Community Support

Hi @maxduff59 ,

 

It seems to work fine in my side:

vjianbolimsft_5-1659092301796.png

vjianbolimsft_6-1659092317013.png

Output:

vjianbolimsft_8-1659092360109.png

 

 

Here is the M code:

 

let

    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrXQMzNXitWJVjI31jMzBLMM9YwgDCM9cwswwxgirhQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),

    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type number}})

in

#"Changed Type"

 

 

Beasides, you can try :

vjianbolimsft_9-1659092398778.png

 

vjianbolimsft_3-1659092172114.png

Then keep the column you need

Output:

vjianbolimsft_4-1659092242856.png

Here is the M code:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrXQMTNXitWJVjI31jEzBLMMdYwgDCMdcwul2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type number}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each [Column1]/100),
    #"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"})
in
    #"Removed Other Columns"

 

Please provide me with more details about your data and your error or share me with your pbix file after removing sensitive data.

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

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

danextian
Super User
Super User

Hi @maxduff59 

 

For this: I have columns with number in a text format such as '58.67'. I cannot convert it to decimal directly (I have an error) 

What is the error?

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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