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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
yakovlol
Resolver I
Resolver I

Calculate Average without Zero values based on measure

Hello Team,
Could you please help me with creating a measure?
I need to Calculate the Average for (No group) ignoring zeros. The values for the second column are based on another measure [Count Month]. So I need to ignore zeros but to leave them in the matrix. 

Average CountMonths = 
AVERAGEX(VALUES(Table1[id]),[Count Months])

My matrix with the current calculation

yakovlol_0-1689232700703.png

 

Desired output to have 2 for "No group", but 0 should stay where they are

yakovlol_1-1689232700723.png

Many thanks for you help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @yakovlol ,

 

I suggest you to create a new [Average CountMonths] table based on original one.

New Average CountMonths = 
AVERAGEX(FILTER(VALUES(Table1[id]),[Average CountMonths]<>0),[Average CountMonths])+0

 

Best Regards,
Rico Zhou

 

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
mlsx4
Memorable Member
Memorable Member

Maybe you can add a filter:
 
Average CountMonths =
AVERAGEX('Table1',CALCULATE([Count Months],FILTER('Table1',[Count Months]<>0)))

Hello @mlsx4 

Many thanks for your help, but when I'm using this measure I have 1.00 everywhere, actually don't know why.
But for id 5 and 7 I need to have 3.00 like in picture above

Average CountMonths =
AVERAGEX('Table1',CALCULATE([Count Months],FILTER('Table1',[Count Months]<>0)))

yakovlol_0-1689235648046.png

 

Anonymous
Not applicable

Hi @yakovlol ,

 

I suggest you to create a new [Average CountMonths] table based on original one.

New Average CountMonths = 
AVERAGEX(FILTER(VALUES(Table1[id]),[Average CountMonths]<>0),[Average CountMonths])+0

 

Best Regards,
Rico Zhou

 

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

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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