Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ntruong1994
Frequent Visitor

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 

 

ntruong1994_0-1713341500651.png

Really appreciate your help  

 

Regards, 

NT 

1 ACCEPTED SOLUTION
dufoq3
Super User
Super User

The easiest way is:

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

dufoq3_0-1713358668345.png

 

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).

dufoq3_1-1713358893723.png

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

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

1 REPLY 1
dufoq3
Super User
Super User

The easiest way is:

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

dufoq3_0-1713358668345.png

 

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).

dufoq3_1-1713358893723.png

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

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors