Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Show 0 for empty cells in table

I am wondering if there is something similar to excel/pivot table"For empty cells show" (see picture below) in Power BI table/matrix visuals?

I know that is it possible to solve using DAX (replacing empty with 0 in the measure calculation) but I have a lot of measures that would need to be changed in that case

 

 

  • Anonymous No, you would have to solve that in DAX. There is a "Show values with no data" but that just shows blanks if that is what the measure returns.

  • Hi Anonymous ,

    Adjust the corresponding measures, which have null values that you want to transform to 0:

     

    newmeasure= var beforemeasure=(here is the measure you used before)
    return if(beforemeasure=blank(),0,beforemeasure)

     

     

    Wish it is helpful for you!

    Best Regards

    Lucien

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous No, you would have to solve that in DAX. There is a "Show values with no data" but that just shows blanks if that is what the measure returns.

    • Syndicate_Admin's avatar
      Syndicate_Admin
      Icon for Administrator rankAdministrator

      Could use mwhite space

      Then create a measure with the function

      SELECTEDVALUE, this function returns the value if the columnName context has been filtered to a single different value. Otherwise, it returns alternateResult. (in this case we will assign a 0 to the alternative value)
  • v-luwang-msft's avatar
    v-luwang-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    Adjust the corresponding measures, which have null values that you want to transform to 0:

     

    newmeasure= var beforemeasure=(here is the measure you used before)
    return if(beforemeasure=blank(),0,beforemeasure)

     

     

    Wish it is helpful for you!

    Best Regards

    Lucien