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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
joglidden2
Post Patron
Post Patron

Count in related table removes rows rather than setting them to zero

I have two tables, many-one. I am counting instances in the many, in the one. It works, but for rows in the one, where there are no instances in the many, Power BI is REMOVING the row. I don't want this. I want the row to remain, and for the count to be ZERO

 

Any ideas, or should I just bail on PBI and do this in a SQL View? (I would have been done with this in the time it took me to post this). 

 

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @joglidden2 ,

 

Did want show items with no data. Please refer this article.

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-show-items-no-data 

vchenwuzmsft_0-1644211874237.png

Or you can replace this result by a new measure.

Measure = 
IF( ISBLANK( SUM( table[field] ) ), 0, SUM( table[field] ) )

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
joglidden2
Post Patron
Post Patron

@v-chenwuz-msft That was it! Never noticed that before. Thanks a lot. 

v-chenwuz-msft
Community Support
Community Support

Hi @joglidden2 ,

 

Did want show items with no data. Please refer this article.

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-show-items-no-data 

vchenwuzmsft_0-1644211874237.png

Or you can replace this result by a new measure.

Measure = 
IF( ISBLANK( SUM( table[field] ) ), 0, SUM( table[field] ) )

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

joglidden2
Post Patron
Post Patron

Ok, update on this one: by adding a duplicate row of the ID column, and then setting it to 'Count', I was able to get all the 'blank' rows back. Instead of a zero, they render blank for the count in many. 

Then, go to field formatting, and make that new count column disappear. There's got to be a better way. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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