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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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 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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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