Forum Discussion
kfschaefer
10 years agoHelper IV
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 x...
- 10 years ago
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
kcantor
10 years agoCommunity Champion
Select the column in your data model and change the data type in the ribbon.
S184019
7 years agoAdvocate III
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?