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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Masha
Frequent Visitor

How to exlude SUM of zero

Hi,

 

Here is a measure SUM (0+0+0+0.6+0.6+0.6...) divided by COUNT of dates.

The question is how to exclude those dates when summary equals 0.00 from this calculations?

Currently it calculates: 4.2 / 12 = 0.35

I need it to calculate: 4.2 / 7 = 0.6

the reason 0.00 is showing for some dates is because in the data there is 0.6 but later on there was another data added with -0.6 for those dates. Hence below we see the summary.

Dax calc.PNG

 

Thank you!

1 ACCEPTED SOLUTION
Masha
Frequent Visitor

Thank you all!

 

I could not make it work in DAX. I amended it at the data level: grouped and filtered out zero. That worked 

View solution in original post

4 REPLIES 4
Masha
Frequent Visitor

Thank you all!

 

I could not make it work in DAX. I amended it at the data level: grouped and filtered out zero. That worked 

Anonymous
Not applicable

Hi,

 

What about creating several measures:

1 measure to calculate the sum for the data, such as

Total Data:= SUM(table[Data])

 

1 measure to count the number of total greater than 0, such as 

Not Null Count := COUNTX('Calendar'[Date], [Total Data] >0)

 

1 measures to do the division:

Average Data:= DIVIDE([Total Data], [Not Null Count])

I think that should work if my assumption are correct:

  • You have a date table,
  • You use the measure average data in your matrix.

 

amitchandak
Super User
Super User

@Masha , Have you used show item with no data, because I can see blank too

 

Usually, we do like

 

if([Meausre] =0.0 ,blank(), [measure])

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

@amitchandak 

yes, but sadly it doesn't work, because in the data it is 0.6-0.6 and in the report it's displayed as 0.00

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.