Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Convert Text to number with DAX

I have a derived column but the number there is in text format. I have tried different DAX formular to conver it to the right format(integer) but always get error e.g 

size integer = CONVERT(Sheet2[Size Value],INTEGER) =======> Cannot convert value '' of type Text to type Integer.
 
I was thinking maybe because there are some blank rows but not sure. Can someone hlep with the right DAX formular. Thanks.
  • tamerj1's avatar
    tamerj1
    4 years ago

    Anonymous 
    Actually I was expecting this response. Apparently you have more than just numbers in this column. In order to detect the cell(s) that have the problem use the following code then look for the blank cells:

    IFERROR ( VALUE ( Sheet2[Size Value] ), BLANK ( ) )

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi tamerj1 

    Thank you!!! , that worked for me. I have tried using blank before but did not work but the IFERROR statement helped. Thank you so much.

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 
    Try VALUE function >>> VALUE ( Sheet2[Size Value] )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the response. Unfortunately I still face the same issue.

      • tamerj1's avatar
        tamerj1
        Icon for Community Champion rankCommunity Champion

        Anonymous 
        Actually I was expecting this response. Apparently you have more than just numbers in this column. In order to detect the cell(s) that have the problem use the following code then look for the blank cells:

        IFERROR ( VALUE ( Sheet2[Size Value] ), BLANK ( ) )