Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi, I would like to ask, in PQ, is there any way I could replace the value based on columns' name?
| ID | Group | Cost 1 | Cost 2 | Price 1 | Price 2 |
| 1 | A | - | 0.8 | - | -0.11 |
| 2 | B | 0.4 | - | - | 0.23 |
| 3 | - | 0.5 | - | 0.6 | - |
| 4 | C | - | 0.4 | 0.1 | - |
| 5 | D | 0.6 | 0.2 | 0.54 | 0.57 |
Like in this case, I would like to replace "-" with 0, but only apply to columns' name started with "Cost" & "Price"
Appreciated if any solutions.
Solved! Go to Solution.
Hi @ngct1112
Table.ReplaceValue(yourPreviousStep,"-",0,Replacer.ReplaceValue, List.Select( Table.ColumnNames( yourPreviousStep), each Text.Contains(_,"Cost") or Text.Contains(_,"Price")))
Hi @ngct1112
Table.ReplaceValue(yourPreviousStep,"-",0,Replacer.ReplaceValue, List.Select( Table.ColumnNames( yourPreviousStep), each Text.Contains(_,"Cost") or Text.Contains(_,"Price")))
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.