cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
audi357 Frequent Visitor
Frequent Visitor

New Measure to calculate Average and count Zero/Null values

New User****
Trying to caluclate Avearage across years by row.

 

Count of charge average per Year =
AVERAGEX(
KEEPFILTERS(VALUES('Calendar'[Year],)),
CALCULATE(COUNTA('armain'[charge])
))

 

This Quick measure works but Does not account for years where no value was calculated.    Hence, Aggravated Battery  was 1 for 2016, and 1for 2017.  average should be 0.5.

 

Please help

 

Avg.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-yulgu-msft
Microsoft

Re: New Measure to calculate Average and count Zero/Null values

Hi @audi357,

 

Count of charge average per Year =
COUNTA ( 'armain'[charge] ) / DISTINCTCOUNT ( 'Calendar'[Year] )

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

1 REPLY 1
Microsoft v-yulgu-msft
Microsoft

Re: New Measure to calculate Average and count Zero/Null values

Hi @audi357,

 

Count of charge average per Year =
COUNTA ( 'armain'[charge] ) / DISTINCTCOUNT ( 'Calendar'[Year] )

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors