Forum Discussion

ntruong1994's avatar
ntruong1994
Frequent Visitor
2 years ago
Solved

Replace values in a column to BLANK/NULL

Hi all,

Is it possible to replace all values in a column to BLANK/NULL using Power Query ? There are some sensitive information I want to remove but still need to keep the column header 

 

Really appreciate your help  

 

Regards, 

NT 

  • The easiest way is:

    1. Delete your column.
    2. Create new custom column (with same name as previously deleted column) and put value null.

     

    If you want to do this for multiple columns you can use this code as a new step

    Just replace Previous_Step_Name with your previsous step reference and replace "Column1", "Column2" in curly brackets with your column names (or add more).

    = Table.ReplaceValue(Previous_Step_Name, null, each null, (x,y,z)=> z, {"Column1", "Column2"})

1 Reply

  • dufoq3's avatar
    dufoq3
    Icon for Community Champion rankCommunity Champion

    The easiest way is:

    1. Delete your column.
    2. Create new custom column (with same name as previously deleted column) and put value null.

     

    If you want to do this for multiple columns you can use this code as a new step

    Just replace Previous_Step_Name with your previsous step reference and replace "Column1", "Column2" in curly brackets with your column names (or add more).

    = Table.ReplaceValue(Previous_Step_Name, null, each null, (x,y,z)=> z, {"Column1", "Column2"})