Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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 number | Stock | Sold | Returns |
1 | 121 | 89 | 32 |
2 | 212 | 200 | 12 |
3 | 142 | 0 | 0 |
4 | 846 | 845 | 1 |
5 | 0 | 500 | 52 |
6 | 231 | 0 | 200 |
7 | 514 | 51 | 0 |
8 | 874 | 551 | 323 |
9 | 0 | 84 | 464 |
10 | 152 | 54 | 0 |
11 | 560 | 0 | 360 |
12 | 614 | 614 | 0 |
Solved! Go to Solution.
You can replace
{"Week number", "Stock", "Sold", "Returns"}
with
Table.ColumnNames(Source)
You can replace
{"Week number", "Stock", "Sold", "Returns"}
with
Table.ColumnNames(Source)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |