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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
xryu
Frequent Visitor

How to show all rows including the 0 value rows in the aggregated table.

Hello,

 

We have 4 companies, i.e. A, B, C, and D.

We have a table that records the item sales amount of each company, sample is shown below.

SalesTable

CompanyAmount
A10
B12
A15
D13
B25
B31
A21
D26
B32
A27

 

I need to calculate the total sales amount of each company and show in the result table.

Regardless the total sales amount is 0 or not, all companies are expected to show in the result table.

As shown in the below sample result table, total sales of Company C is 0, but it still shows up in the result.

Expected Result:

CompanyTotal Amount
A73
B100
C0
D39

 

I am implementing this aggregating calculation using the "Group By" in Power BI, however, Company C is NOT shown in the result table because the total sales amount is 0.

Result in Power BI:

CompanyTotal Amount
A73
B100
D39

 

Is there a way that we can get the full company list with the aggregate sales amount, even if it is 0 in Power BI?

Thank you for your kindly help!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@xryu , Create a company table with distinct companies and then join it back with company and use a measure with +0 

 

Company  = distinct(Table[Company]) // Make sure C is there , or bring from source

 

measure =  sum(Table[Sales]) +0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@xryu , Create a company table with distinct companies and then join it back with company and use a measure with +0 

 

Company  = distinct(Table[Company]) // Make sure C is there , or bring from source

 

measure =  sum(Table[Sales]) +0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi amitchandak,

 

Thank you for the idea.

We were able to have Company C show up in the result table after left outer joined the company dictionary table to the aggregation result table, as you pointed out.

Somehow, the measure = sum(Table[Sales]) +0 did not work for us, but we were able to replace the null to 0

using the function in the Power Query Editor.

xryu_0-1680274548847.png

 

Thank you for your help, it really helped!

 

Bests.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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