Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nickelcap
Frequent Visitor

"(Blank)" in Card Visual For 0 Count

Hi Everyone,

 

I'm not sure if I encountered a bug or if I'm doing something incorrectly. I put together a card visual that provides a count of the assets that meet a certain set of criteria. I'm using three columns for the visual: "Asset", "Colour Formatting", and "Latest". "Asset" provides the asset name; "Colour Formatting" reports a 0, 1 or 2 based on certain criteria; and "Latest" finds the latest time stamp for each asset. If that's not clear, here's a snippet of the data:

 

PBI (1).png

 

And here's a snippet of the set up for the visual:

 

PBI(2).PNG

 

The count is set as Count (Distinct). Now, the filters I'm applying will mean that there will be 0 assets in the count (I know this by manually checking), but it shows '(Blank)' in the card. I know this set up works because I'm using something very similar for another count, the only difference being that Colour Formatting is set as 2. Is there a workaround for this?

 

Thanks,

 

Dan

 

 

 

 

 

1 REPLY 1
Anonymous
Not applicable

Ya, this is the "by design" behavior.  Taking a sum of a "no rows" returns a blank, not zero.  Same with distinctcount etc.

 

I would just write a custom measure:

  My Distinct Count := DISTICTCOUNT(MyTable[MyColumn]) + 0

 

The +0 will obviously have no impact on any "valid" result, but Blank + 0 will be 0, and should give you what you want.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.