Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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:
And here's a snippet of the set up for the visual:
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
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.
User | Count |
---|---|
84 | |
78 | |
70 | |
47 | |
42 |
User | Count |
---|---|
106 | |
50 | |
49 | |
40 | |
40 |