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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cannot Convert Text to Decimal

Hi everyone!

 

I think I tried posting this question but I'm not sure if it went through because I had to create an account.... so apologies if this is a re-post! I am new to the Power BI Community. 

 

I'm looking for some help regarding data that is being pulled from Microsoft Planner and the type is being pulled as text. I've attached a screenshot below of the data I am trying to convert to a decimal. For example, it shows the completed checklist items out of total checklist items, but shows 3/5 as text. I want to convert it to show .6 or 60% instead, but when I do this, I get a column full of errors. Any help would be very much appreciated. 

 

Thank you!Screenshot of textScreenshot of text

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

Hi @Anonymous ,

 

Power BI can't recognize the "/" as "÷".

You can use Split feature in Query Editor then add a new column =column1/column2

3.PNG

4.PNG

5.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

5 REPLIES 5
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Power BI can't recognize the "/" as "÷".

You can use Split feature in Query Editor then add a new column =column1/column2

3.PNG

4.PNG

5.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

Thank you very much! This was super helpful and now it's working properly.

 

I appreciate all the responses! 

amitchandak
Super User
Super User

New column =
var _pos = search("/",[column],,0)
var _len =len([column])
return
if(isblank([column]),0,divide(left([column],_pos-1),right([column],_len-_pos)))

lkalawski
Memorable Member
Memorable Member

Hi AlexandraC7,

 

The easiest way to get percentages is to perform these actions using additional columns.
1. Separate the denominator and denominator, and then add the column that will perform the (Custom) action.
2. Delete unnecessary columns.

Ex1.png

 

#"Split Column by Delimiter" = Table.SplitColumn(#"Changed Type", "Column1", Splitter.SplitTextByDelimiter("/", QuoteStyle.None), {"Numerator", "Denominator"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Numerator", Int64.Type}, {"Denominator", Int64.Type}}),
    #"Added Conditional Column" = Table.AddColumn(#"Changed Type1", "Custom", each if [Denominator] = null then [Numerator] else [Numerator]/[Denominator]),
    #"Changed Type2" = Table.TransformColumnTypes(#"Added Conditional Column",{{"Custom", Percentage.Type}})

 

 



_______________
If I helped, please accept the solution and give kudos! 😀

az38
Community Champion
Community Champion

Hi @Anonymous 

it looks like your "null" is not exactly null.

try to replace value to to '' (blank) before convert the data type


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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