Przemyslaw Remin
Przemyslaw Remin

Reputation: 6940

How to replace text with null in powerquery?

I would like to replace "ValueToReplace" with null in powerquery. This does not work (returns error):

Table.ReplaceValue(#"Previous Step","ValueToReplace", null ,Replacer.ReplaceText,{"Col1"})

This works but it returns "" instead of null:

Table.ReplaceValue(#"Previous Step","ValueToReplace","",Replacer.ReplaceText,{"Col1"})

Upvotes: 2

Views: 12933

Answers (1)

Alexis Olson
Alexis Olson

Reputation: 40204

I think it's because null isn't a text value, so you need to use ReplaceValue instead of ReplaceText.

Table.ReplaceValue(#"Previous Step","ValueToReplace",null,Replacer.ReplaceValue,{"Col1"})

Upvotes: 10

Related Questions