Reply
Highlighted
po Member
Member
Posts: 109
Registered: ‎09-24-2018
Accepted Solution

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

[ Edited ]

 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


Accepted Solutions
Community Support Team
Posts: 2,769
Registered: ‎02-06-2018

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

@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


All Replies
Community Support Team
Posts: 2,769
Registered: ‎02-06-2018

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

@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.

po Member
Member
Posts: 109
Registered: ‎09-24-2018

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

Thanks for suggestion