cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kfschaefer Member
Member

Convert text to number

What is the proper syntax to convert a text into a number format?

 

I need to convert some import data(xls) that for some reason is coming accross as text instead of a number.  It is formatted in xls as a currency, but in BI it is a text field.  FieldName("PEPM Revenue"), needed to be a number due to summarizing the field.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Convert text to number

Couple different methods, you can choose number or currency from the Modeling tab in the Data Type section and it will generally convert it just fine. There is also the VALUE function:

https://msdn.microsoft.com/en-us/library/ee634584.aspx

 


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

View solution in original post

6 REPLIES 6
kcantor Super Contributor
Super Contributor

Re: Convert text to number

Select the column in your data model and change the data type in the ribbon.

 percentage.JPG



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

Proud to be a Datanaut!




Super User
Super User

Re: Convert text to number

Couple different methods, you can choose number or currency from the Modeling tab in the Data Type section and it will generally convert it just fine. There is also the VALUE function:

https://msdn.microsoft.com/en-us/library/ee634584.aspx

 


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

View solution in original post

kfschaefer Member
Member

Re: Convert text to number

Thanks I found this answer at the same time you posted.

 

K

Nargiz1977 Frequent Visitor
Frequent Visitor

Re: Convert text to number

exl file uploaded as a text. I try to convert text to number but unsucsessfuly. Could anybody advice why exl converted to text in POWER BI after upload, and how to convert text to value

MOHUS Frequent Visitor
Frequent Visitor

Re: Convert text to number

Hi,

 

Had the same issue but the problem is it when changing the format from text to numbers it removes any decimel points? so if the number is for instance (2,28) when text, it become's (228) after changing the format to number. Any suggesitons?

S184019 Regular Visitor
Regular Visitor

Re: Convert text to number

@kcantor What if the column doesn't yet exist.  What if for example, i am building a summary table in dax?  

 

Summary = SUMMARIZE(PreSummary,PreSummary[Date].[Month],PreSummary[Date].[Year],
"Column_1",calculate(Sum(PreSummary[somecolumn1])),
"Column_2",calculate(sum(PreSummary[somecolumn2])),
"Column_3",calculate(sum(PreSummary[somecolumn3])),
"YRMO",CALCULATE(VALUE(PreSummary[Month])),  <--I want to treat this like a number. 
"OLDTotal",CALCULATE((sum(PreSummary[Total])))))
 
The back story is that I HOPE to be able to sort columns in a matrix by a number. That number here is the YEAR concatenated with the 2 digit month that way I know it will stay in order.  But I must "Summarize" that table somehow.  Thoughts? 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 789 guests
Please welcome our newest community members: