Forum Discussion

ZachUnger's avatar
ZachUnger
Helper II
3 years ago
Solved

Type text to Type Number

Hi Team    I'm trying to create a column to show "over 24 hours as text for the below query but keep getting an error of "Cannot convert value 'Over 24 Hours' of type Text to type Number".   Can ...
  • ZachUnger's avatar
    ZachUnger
    3 years ago

    Thanks, doing that then gives me the below error...

    Cannot convert value 'Over 24 Hours' of type Text to type Integer.

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi ZachUnger ,

     

    Please try.

    Column = 
    SWITCH(
        TRUE(),
        'DATA'[HrsBtwRecievedandAssigned]<=0,"0",
        'DATA'[HrsBtwRecievedandAssigned]<=2,"2",
        'DATA'[HrsBtwRecievedandAssigned]<=24,"24",
        "Over 24 Hours"
    )

    In desktop please make sure the final output type is the same.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum