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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I hope to replace values for all columns no matter how many new columns will be added in the future?
Currently I do it ranging particular columns but will come more new columns over time.
Solved! Go to Solution.
Hi @Anonymous - you can modify your Power Query (M code) script to dynamically apply the replacement logic to every column in the table.
slight adjustment as per the mcode change,
#"Replaced Value" = Table.ReplaceValue(
#"Filtered Rows",
null,
0,
Replacer.ReplaceValue,
Table.ColumnNames(#"Filtered Rows")
)
Locate the step where you are replacing values.
Replace your existing hardcoded column names with the dynamic method shown above.
Save and apply the changes.
Proud to be a Super User! | |
Hi @Anonymous - you can modify your Power Query (M code) script to dynamically apply the replacement logic to every column in the table.
slight adjustment as per the mcode change,
#"Replaced Value" = Table.ReplaceValue(
#"Filtered Rows",
null,
0,
Replacer.ReplaceValue,
Table.ColumnNames(#"Filtered Rows")
)
Locate the step where you are replacing values.
Replace your existing hardcoded column names with the dynamic method shown above.
Save and apply the changes.
Proud to be a Super User! | |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |