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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Auto replace all values in all columns with specific value

Hello,

I have the following table loaded in Power Query which is updated regularly with changing number of columns in the source Excel spreadsheet. I am trying to find a dynamic way to replace all values in the entire table where it is 0 to null. Is this possible?

 

Currently, this is the step used but it is not dynamic when the columns change:

 

= Table.ReplaceValue(Source,"0",null,Replacer.ReplaceValue,{"Week number", "Stock", "Sold", "Returns"})

 

 

Week numberStockSoldReturns
11218932
221220012
314200
48468451
5050052
62310200
7514510
8874551323
9084464
10152540
115600360
126146140
1 ACCEPTED SOLUTION
artemus
Microsoft Employee
Microsoft Employee

You can replace 

{"Week number", "Stock", "Sold", "Returns"}

with

Table.ColumnNames(Source)

View solution in original post

1 REPLY 1
artemus
Microsoft Employee
Microsoft Employee

You can replace 

{"Week number", "Stock", "Sold", "Returns"}

with

Table.ColumnNames(Source)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.