Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Conditional Formatting - Find/Replace

Hi there,

 

Is it possible to do a find/replace on a grid so that I can create a rule where if the cell in the grid is null I can have a 0 show up instead? I have two tables joined together and one of the categories in one table is not in the other so the metrics show as null. I cannot do a find/replace in the Query editor because the category doesn't exist in the other table. 

The only thing I can think of right now is to add a row to the table with the missing category and fill in all the metric values with 0 but it's pretty bad practice to modify the original dataset itself so I'd prefer not to do that.

 

I am a former MicroStrategy user so I'm used to having this functionality but it looks like it's not available in PowerBI. Please prove me wrong!!

  • Nathaniel_C's avatar
    Nathaniel_C
    6 years ago

    Hi Anonymous ,
    If what you are trying to do is a visual, you can use a measure:

    Budget2 measure = IF(MAX(ExpensesTable[Budget])>0,MAX(ExpensesTable[Budget]),0)

     


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      No unfortunately that does not solve my problem. I attached a photo which hopefully clarifies my situation so you can see why I cannot do a find/replace in the Query Editor to replace all the nulls with zeros.

      • Nathaniel_C's avatar
        Nathaniel_C
        Community Champion

        Hi Anonymous ,
        So, operating on the ExpensesTable I merged the two, see bottom picture. Then expanded and ended up with the null in middle picture. Finally in the top picture, I did a replace value.  If your concern is adding a column to an existing table in the process, you can always copy or reference the table before you begin this process.  

        Let me know if you have any questions.

        If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
        Nathaniel