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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
dragon2
Frequent Visitor

SUMMARIZE a table with matrix, but show zeroes instead of blanks

Hello,

 

I'm trying to summarize a table, but I need there to be zeroes instead of blanks. Because there is no Aldi - Peanut - G - 2000 data in Sheet1, summarize does not create a zero for this; the same can be said for the other blanks.

 

Table = SUMMARIZE(Sheet1,Sheet1[Store],Sheet1[Flavor],Sheet1[Brand],Sheet1[Year],"variable","total","count",COUNT(Sheet1[ID]))

Capture.JPG

IDStoreFlavorBrandYear
1KrogerAppleA2000
2KrogerAppleA2000
3KrogerAppleB2001
4KrogerPearB2001
5KrogerPearC2002
6KrogerPearC2002
7WalmartPeachD2000
8WalmartPeachD2000
9WalmartPeachD2001
10WalmartPeachD2001
11WalmartPeachD2002
12WalmartPeachD2002
13WalmartSmokeyE2001
14MeijerSmokeyF2000
15MeijerSmokeyF2001
16MeijerSmokeyF2001
17MeijerCherryF2002
18MeijerCherryG2002
19AldiPeanutG2001
20AldiPeanutG2002
1 ACCEPTED SOLUTION
dragon2
Frequent Visitor

To solve this problem, I used both @ryan_mayu and @AilleryO solutions. My summarize function will work fine, but after that, you must create a "Year" table like ryan_mayu advises, then you must create a measure that adds 0 as AilleryO advises. For my case, that would be:

Measure = CALCUALTE(SUM('Table'[count]))+0

 

Thank you both for the help.

View solution in original post

6 REPLIES 6
dragon2
Frequent Visitor

To solve this problem, I used both @ryan_mayu and @AilleryO solutions. My summarize function will work fine, but after that, you must create a "Year" table like ryan_mayu advises, then you must create a measure that adds 0 as AilleryO advises. For my case, that would be:

Measure = CALCUALTE(SUM('Table'[count]))+0

 

Thank you both for the help.

AilleryO
Memorable Member
Memorable Member

Hi,

Did you try to add 0 to your measure ?

MyMeasure = SUM( MyColumn) +0

Let us know.

 

v-priyankata
Community Support
Community Support

Hi @dragon2 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

ryan_mayu
Super User
Super User

@dragon2 

you can create a new table 

 

Table 2 = DISTINCT('Table'[Year])
 
create relationship between two tables.
 
then add the year column from new table to the column field
 
11.png




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




This is a great solution if I do not use SUMMARIZE, but I unfortunately need to use SUMMARIZE for this because I'm going to union summarize tables to show different "variables" (column in my original post).

sry don't know why need to use summarzie function. What if you connect the new table to your summarized table?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

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

OSZAR »