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
Anonymous
Not applicable

Wrong result of Convert String to Int

Hi, I have table Units with column UnitId1 which contain numbers in format string, I created calculated column UnitId with function

 
UnitId = CONVERT(Units[UnitId1], INTEGER)

 

but it return 1 for all rows. See picture. What is wrong?

 

PetrK_0-1668184715535.png

Thank you for help

1 ACCEPTED SOLUTION
djurecicK2
Super User
Super User

Hi @Anonymous ,

 

Hi PetrK,

 Is it possible that the matrix is showing a count of UnitID or other aggregation of the column? What does data view show?

View solution in original post

3 REPLIES 3
mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

why don´t you change the data type in power query? It is much easier in my opinion.

mangaus1111_0-1668185579546.png

 

 

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

Anonymous
Not applicable

Data source is Direct Query, so it is not possible to use Power Query. I have found cause. In visual table column UnitId was set on "Count". After change to "Don't summarize" it is OK

 

 

 
 

 

 

djurecicK2
Super User
Super User

Hi @Anonymous ,

 

Hi PetrK,

 Is it possible that the matrix is showing a count of UnitID or other aggregation of the column? What does data view show?

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.