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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

3 REPLIES 3
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.

That worked for me too. But I need to apply this logic to a daily average.

So it would be the mix of the 2 below. Any idea how to do it?

Daily average
AVERAGEX(VALUES(dim_calendar[Date]),[Measure])

Excluding blank
AVERAGEX(VALUES(dim_calendar[Date]), FILTER(table, [Measure] <> BLANK()))

Thanks for suggestion

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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