Search code examples
powerquerym

Using Power Query, can you use an IF statement to determine whether a value is a number in two different columns?


I'm attempting to sort a list of two columns containing both numbers and text on whether or not a value is text or a number.

if ((Value.Is(Value.FromText([OLD ITEM]), type number) = "TRUE") or if ((Value.Is(Value.FromText([NEW ITEM]), type number) = "TRUE")
then "FIXTURE"
else ""

Currently its giving me an error that the second "Value.Is" is incorrect.


Solution

  • I should have used

    =if Value.Is(Value.FromText([OLD ITEM]), type number) and Value.Is(Value.FromText([NEW ITEM]), type number)
    then "ITEM"
    else "")
    

    It didn't need the ="TRUE".