Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Remove error format value in query

Hi,

I have a column '공사번호' in Number format but sometimes data uploaders do errors so Text values updated which get errors. 

Is there any way I can filter out if there is any not Number values? 

 

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anonymous 

     

    Thank you very much ryan_mayu for your prompt reply.

     

    Below is a detailed Power Query M code example to help you retain only the numeric values in the '공사번호' column:

     

    Here's some dummy data

     

     

    Load your dataset in Power Query.

     

    In the Power Query editor, click Advanced Editor.

     


    Add the following code:

     

    #"Filtered Rows" = Table.SelectRows(Source, each Value.Is(Value.FromText([공사번호]), type number))

     

     

    Here is the result.

     

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

3 Replies

  • Anonymous 

    you can try to create a new column

     

    = Table.AddColumn(Source, "Custom", each try Number.From([Column1]) otherwise "")

     

     

    then filter out the blank rows in the new column

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    Thank you very much ryan_mayu for your prompt reply.

     

    Below is a detailed Power Query M code example to help you retain only the numeric values in the '공사번호' column:

     

    Here's some dummy data

     

     

    Load your dataset in Power Query.

     

    In the Power Query editor, click Advanced Editor.

     


    Add the following code:

     

    #"Filtered Rows" = Table.SelectRows(Source, each Value.Is(Value.FromText([공사번호]), type number))

     

     

    Here is the result.

     

     

    Regards,

    Nono Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi, 
      can we filter multiple columns in one code? 

      first column '공사번호' to number format and second column '준공예정일자' to date format.