Forum Discussion
Replace null(s) in a list
- 6 years ago
Hi!
The only replacement needed in your situation is {null, "NA"}, without quotes on null, and that's why your first code works and the second one doesn't.
Your function should work properly this way:
(others as list) =>
let
listA = List.ReplaceMatchingItems(others, {{null, "NA"}})
in
listA
I'm glad I could help you. See ya.
- 6 years ago
Hi Anonymous
Because in Power query, null means null value type, "null" mean a text field which its value is "null".
In your example, your data example show null value type, so the query with {{"null", "NA"}} doesn't work.
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Hi, try using this in a custom column:
List.ReplaceMatchingItems([Column1.values],{{null,-1}})Regards
Victor