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

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

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Kudoed Authors