Power Query – Add Column to see if it is a Number Data Type
I was recently extracting some data from a web page and I wanted to remove all the rows that did not have a Numeric or Number value.
I solved it by doing the following below.
The column I was using was called ironically Column5
The syntax below can be used in Power Query / Query Editor to see if the column contains Numbers or not
Value.Is(Value.FromText([Column5]), type number)
This is what the Added Column looks like below.
As I have shown above in the IsNumber column where there was no number it was set to FALSE.
This then allowed me to filter out the rows that were NOT numbers.
Thanks for reading and if you have any comments please leave them below.
I would have duplicated the column 5 and changed the data type to Number.
Those values which could not get converted to Number would show as errors. Then I would have simply removed errors.
Hi there
That would work if you wanted to remove the data that is not a number.