cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
po
Post Prodigy
Post Prodigy

AVERAGE including blanks when want it to ignore blanks and 0's by default

 Hi,

 

We have a measure and had thought average exzcluded blanks by default - have lots of rows some with values some with blanks 

We set the measure to blank if value is 0  and then do average on measure but looks to ber still dividng by number of rows as opposed to number of non-blank rows.

 

Can ensure set on database to null and the average works but wondered

 

How can we best acieve an average ignoring values with blank and 0's in power bi?

 

Thanks

 

 

 

average_igoring_blanks_and_0_values.png

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@po,

 

You can create a measure using DAX like pattern below:

Result =
AVERAGEX ( FILTER ( Table, Table[Value] <> BLANK () ), Table[Value] )

Community Support Team _ Jimmy Tao

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

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@po,

 

You can create a measure using DAX like pattern below:

Result =
AVERAGEX ( FILTER ( Table, Table[Value] <> BLANK () ), Table[Value] )

Community Support Team _ Jimmy Tao

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

Thanks for suggestion

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.