Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How to replace several values in a column for a single value (POWER BI QUERY)

Hi,

I have more than 500 different values in a column and I need to replace all of them for a single value in a new column. How can I do that easily? Is there such a function as replace all values except blank, for a unique value?

 

Thanks, RA

  • hi Anonymous 

    try calculated column

    Column = IF(
    isBlank('Table'[Field]);blank();"YourNewValue")
    )

    do not hesitate to give a kudo to useful posts and mark solutions as solution

  • az38's avatar
    az38
    6 years ago

    hi Anonymous 

    it should work

    = if [Column1] = null then null else "YourValue"

    do not hesitate to give a kudo to useful posts and mark solutions as solution

6 Replies

  • az38's avatar
    az38
    Community Champion

    hi Anonymous 

    try calculated column

    Column = IF(
    isBlank('Table'[Field]);blank();"YourNewValue")
    )

    do not hesitate to give a kudo to useful posts and mark solutions as solution

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi AZ38 -

      How can I apply this same formula in the POWER QUERY EDITOR?

      In my specific case, it would be better to do this there, by addin a Custom column.\

      Pls, let me know.

      Thank you. RA

      • az38's avatar
        az38
        Community Champion

        hi Anonymous 

        it should work

        = if [Column1] = null then null else "YourValue"

        do not hesitate to give a kudo to useful posts and mark solutions as solution

  • Go to power query editor - -> take duplicate of your required column - -> then right on that duplicate column - -> select replace option and enter needed value of yours - -> click OK.

    Please don't forget to give Kudos and accept this as a solution if it helps you.
  • Anonymous's avatar
    Anonymous
    Not applicable

    Follow the following. Remember you need to add several entries then the system makes a rule and follows the rule.