Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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")))