# average dax formula



## deedee88 (Apr 19, 2014)

Hi,

I need a formula to calculate the average of a column but to exclude the cells with zero amounts. I removed the zeros from my data and this seems to work, but I am sure there is an easier way.


Any help will be appreciated.

Thanks,


----------



## pgc01 (Apr 19, 2014)

Hi

Check the function AverageIf()


----------



## deedee88 (Apr 19, 2014)

Hi,

Powerpivot does not have a AverageIf function.

Thanks,


----------



## pgc01 (Apr 19, 2014)

Sorry, you are right, I did not notice this was a PowerPivot question.

Well, I added a table named MyTable, with one of the fields named Value and used this measure to get the average of that field excluding zeroes:

AverageNotZero:=AVERAGEX(FILTER(MyTable,MyTable[Value]>0),mytable[Value])

Please adapt and try.


----------



## deedee88 (Apr 20, 2014)

Thank you!....It's perfect


----------



## pgc01 (Apr 20, 2014)

You're welcome. Thanks for the feedback.


----------

