Skip to main content

Power BI

Declined

Count should return 0 instead of (Blank)

Vote (575) Share
Stephane Viot's profile image

Stephane Viot on 07 Oct 2015 23:52:58

Count of should return 0 instead of '(Blank)' (looks better on a Dashboard)

Administrator

You can do this with the COALESCE function: https://docs.microsoft.com/en-us/dax/coalesce-function-dax. For example:

= COALESCE(SUM(FactInternetSales[SalesAmount]), 0)
Comments (54)
Stephane Viot's profile image Profile Picture

Power BI User on 05 Jul 2020 23:36:51

RE: Count should return 0 instead of (Blank)

It would be nice if you add this feature to Power bi.

Stephane Viot's profile image Profile Picture

Power BI User on 05 Jul 2020 23:36:28

RE: Count should return 0 instead of (Blank)

You should have the option to return Blank or 0

Stephane Viot's profile image Profile Picture

C097986 on 05 Jul 2020 23:17:22

RE: Count should return 0 instead of (Blank)

If you have multiple cards and the value shows blank then it's time consuming to write an IF measure for every card. Just seems time consuming and not a very efficient way to display values. Suggestions of putting 0 or None automatically generated from DAX would make it much easier to track values.

Stephane Viot's profile image Profile Picture

Arbin Rai on 05 Jul 2020 23:14:47

RE: Count should return 0 instead of (Blank)

I added a new column 'Zero' with 0 to one of my table. Then add a Quick Measures to my Field in the Card and select Addition for Calculation. Then add Base Value to the column 'Zero' to display 0 on the card if the Field is Blank.
Hope that helps!

Stephane Viot's profile image Profile Picture

Peter Godzina on 05 Jul 2020 23:13:08

RE: Count should return 0 instead of (Blank)

I agree. A lot of upper management and leadership people at my company want to see 0, instead of a blank. Checking a box in the "Matrix" display options would save hours of work writing up a DAX code.

Stephane Viot's profile image Profile Picture

Stuart Charles on 05 Jul 2020 23:08:52

RE: Count should return 0 instead of (Blank)

Sure, you could do this using a new DAX measure, but wouldn't it be better if the Card visuals simply have a checkbox in the visual properties to show either (Blank) or 0?

Stephane Viot's profile image Profile Picture

Mark Mellink on 05 Jul 2020 23:08:38

RE: Count should return 0 instead of (Blank)

Has anyone had this problem before related to this idea? This idea would solve my problem as the + 0 and ISBLANK () solutions do not work for me. If there is anyone that has had my problem before (see: https://community.powerbi.com/t5/Desktop/KPI-Visuals-and-Blank-Issue-with-making-Blank-a-0/m-p/331941#M148417), please let me know if you found a different solution!

Stephane Viot's profile image Profile Picture

Renaud on 05 Jul 2020 23:07:15

RE: Count should return 0 instead of (Blank)

Dax is working fine... blank is blank, not 0. And blank is displayed as blank in many visuals.
But the CARD VISUALISATION is not! it's the one that should be fixed, to either show a real blank or show at least a 0 (maybe with an option "show blank as 0" or something).

Stephane Viot's profile image Profile Picture

Mohammed Muddasar on 05 Jul 2020 23:07:02

RE: Count should return 0 instead of (Blank)

Card is meant to be a first-class visualization, but without this fix must resort to creating card-specific measures. The '+0' solution isn't an option because the same measure is being used in a chart with date axis, and with '+0' I get dates appearing with 0 values when these dates should not be appearing at all.

Stephane Viot's profile image Profile Picture

Mohammed Muddasar on 05 Jul 2020 23:07:02

RE: Count should return 0 instead of (Blank)

Putting more thought into it, I just needed to update my DAX with conditional logic which returned Blank () or 0 depending on the year in the evaluation context. So I don't need to write more measures. DAX is a lifesaver!