Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Replacing string with null in power query

Hey there

 

I'm trying to replace a text string in power query with power query's standard null value. However, whatever the text I try to replace with the null all I get is the same value all over (as show in the following image).

Why I do not simply replace it with ""? Because when I do so, I get two kind of blank values in my dataset:

I've came across with this post, but it does not fix my problem because I have to replace several values at once.

 

Do someone knows how to do that replacement?

 

Thanks in advance.

  • Hi, Anonymous 

    The second part you mentioned is not empty. This means that you have at least one space character in your text.

    If possible, you should first replace ' ' with '' as follows:

     

    = Table.ReplaceValue(#"Renamed Columns"," ","",Replacer.ReplaceText,{"Column3"})

     

     

    Best Regards,
    Community Support Team _ Eason

2 Replies

  • v-easonf-msft's avatar
    v-easonf-msft
    Community Support

    Hi, Anonymous 

    The second part you mentioned is not empty. This means that you have at least one space character in your text.

    If possible, you should first replace ' ' with '' as follows:

     

    = Table.ReplaceValue(#"Renamed Columns"," ","",Replacer.ReplaceText,{"Column3"})

     

     

    Best Regards,
    Community Support Team _ Eason

  • Anonymous , null will be shown as blank in DAX. Sorry, but bot sure what is the issue here?