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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
domtrump
Helper II
Helper II

Calculated column - convert data type

I have a table in my data model that was loaded from a query. I have a column that came over as text. I need an additional column that has this column represented as an integer. No longer have access to the original data source so can't be done in power query. I tried the following from an example in the Help but it just results in error. 

Syntax

DAX
CONVERT(<Expression>, <Datatype>)  

 I type CONVERT(Table[MyTextColumn],INTEGER) 
Error: 

domtrump_0-1711645638522.png

How can I accomplish what I need?

2 REPLIES 2
Anonymous
Not applicable

Hi @domtrump 

 

Thanks for the reply from @lbendlin , please allow me to provide another insight:

In excel, the Syntax of Convert() function is that:

CONVERT(number,from_unit,to_unit)

vzhengdxumsft_0-1712027009422.png

Here are detailed description of this function:

CONVERT function - Microsoft Support

 

Best Regards

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

lbendlin
Super User
Super User

Cannot reproduce

 

Table = ADDCOLUMNS({"10"},"num",CONVERT([Value],INTEGER))
 
Show more of your DAX.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.