Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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")))
Pretty slick, @Vera_33 !
--Nate
Hi @ngct1112
Table.ReplaceValue(yourPreviousStep,"-",0,Replacer.ReplaceValue, List.Select( Table.ColumnNames( yourPreviousStep), each Text.Contains(_,"Cost") or Text.Contains(_,"Price")))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.