Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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?

 

Thank you for help

  • 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?

3 Replies

  • Hi Anonymous ,

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

     

     

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

    • Anonymous's avatar
      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

       

       

       
       

       

       

  • 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?