Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How do I replace non-null values in a Merged Queries table?

Hello

 

How do I replace non-null values in a Merged Queries table?

 

Thanks

  • Anonymous's avatar
    Anonymous
    6 years ago

    hi, you could add an additional conditional column, then populate that based on your values being not null. (enter the word null in the condition).  Then drop the original column and rename your new one. 

    the line of powerquery that gets created is like this: 

    = Table.AddColumn(#"Previous Step Name", "New Column Name", each if [Old Column Name] <> null then "X" else null)

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    I think you'll have to expand your question a little so we can understand the issue

  • Hi Anonymous 

     

    In Power Query:

    Select the column to have values replaced > Go to Transform tab > Select Replace Values > Choose value to be replaced and the required new value.

     

    Pete

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

    Anonymous ,

     

    In query editor, click transform-> replace values as below:

     

     

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I want to replace NON-NULL values with X, how do I represent NON-NULL VALUES in that replace form?

       

      I cannot enter every single value of the column there individually as they are hundreds.

       

      I want to leave NULL values as they are.

       

      Can I use a wildcard or something to represent the NON-NULL values?

      • Anonymous's avatar
        Anonymous
        Not applicable

        hi, you could add an additional conditional column, then populate that based on your values being not null. (enter the word null in the condition).  Then drop the original column and rename your new one. 

        the line of powerquery that gets created is like this: 

        = Table.AddColumn(#"Previous Step Name", "New Column Name", each if [Old Column Name] <> null then "X" else null)