Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I need your help with this weird issue I'm facing. I have a data model similar to the following:
Which is filled with this data:
And now I want to display the "Projects[Project ID]", "ProjectManagers[Name]" and "Count of Purchases[ID]" in a table.
So basically this:
Where
count_purchases = COUNTROWS(Purchases)
But, as you can see, it doesn't show project 4, since it doesn't have any purchases and therefore "count_purchases" is a blank.
I already tried:
count_purchases = COUNTROWS(Purchases) + 0
Which then shows all combinations of "Projects[Project ID]" and "ProjectManager[Name]" and looks like this:
Which is, obviously, not what I want as well.
I also tried:
count_purchases = IF( NOT(ISEMPTY(Purchases)) || ISEMPTY(Projects);
COUNTROWS(Purchases);
0)
Which does give me the expected result of:
But when using this with my bigger model, with more data, takes to long to compute and uses so much RAM, that it doesn't actually display the table anymore.
So my question is:
How would I be able to display zeros instead of blanks in such a table?
Thanks a lot in advance!
Solved! Go to Solution.
Hi @jwidauer,
I test using your sample table, please create calculated column rather than measure in Project Table using the formulas below.
ProjectManagerName = RELATED(ProjectManagers[Name]) CountPurchase = CALCULATE(COUNT(Purchases[Purchase ID]),RELATEDTABLE(Purchases))+0
Then create a table visual to display it as follows.
Best Regards,
Angelia
Try the easiest thing first - is there an option in your visual to show items with no data?
Unfortunately not that I know of.
I'm just using the standard Table visualization that comes with Power BI Desktop.
Odd - in your values section, if you hit the drop down on Project ID I'd have expected an option to be there
WOW Thanks !!
Oh wow!
I totally missed that!
That's a lot better, but do you think it would be possible to show the blank as a "0"?
wrote:Oh wow!
I totally missed that!That's a lot better, but do you think it would be possible to show the blank as a "0"?
Try that +0 workaround you referenced in your original post
That, unfortunately, again shows all combinations of "Projects[Project ID]" and "ProjectManager[Name]", like this:
Hi @jwidauer,
It's hard to calculate the measure based on rules. For example, which name should be displayed when the count_purchases is 0?
Best Regards,
Angelia
Hi @v-huizhn-msft,
So for me to be happy with the result, it would have to only show the combinations of "ProjectManagers[Name]" and "Project[ID]" where they have a relation e.g. the "Project[PM ID]" is equal to the "ProjectManagers[ID]".
From the measure standpoint, it should only display 0, if the "Project[ID]", "ProjectManagers[Name]" combination exists in the data.
I hope this clarifies a bit, what I want to do.
Hi @jwidauer,
I test using your sample table, please create calculated column rather than measure in Project Table using the formulas below.
ProjectManagerName = RELATED(ProjectManagers[Name]) CountPurchase = CALCULATE(COUNT(Purchases[Purchase ID]),RELATEDTABLE(Purchases))+0
Then create a table visual to display it as follows.
Best Regards,
Angelia
Outputting 0 fixes it for the table visual, but not if you are doing calculations on "BLANK" fields. The table visual should NOT hide values with BLANK() (NULL) values.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
70 | |
55 | |
37 | |
31 |
User | Count |
---|---|
83 | |
64 | |
63 | |
49 | |
45 |