Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Conditional column for alphabet and number

How to create a conditional column in Power query, that show "Text" if the column has alphnumeric while "Number" if the the column has value only? Thank you

  • Then use the formula posted earlier

    = try if Value.Is(Number.FromText([Data]), type number) then "Number" else "Text" otherwise "Text"

     

4 Replies

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Icon for Most Valuable Professional rankMost Valuable Professional

    To give you a solution, can you please post some sample data and the results expected? If my understanding is correct, then this formula will work (replace data with your actula column)

     

    = try if Value.Is(Number.FromText([Data]), type number) then "Number" else "Text" otherwise "Text"

     

    • Anonymous's avatar
      Anonymous
      Not applicable

       

      The expected output would be like this

      • Vijay_A_Verma's avatar
        Vijay_A_Verma
        Icon for Most Valuable Professional rankMost Valuable Professional

        Then use the formula posted earlier

        = try if Value.Is(Number.FromText([Data]), type number) then "Number" else "Text" otherwise "Text"