Weighted Averages in PivotTables, Excluding Values Not Available

etsang

New Member
Joined
Mar 15, 2016
Messages
1
Hi, I'm just starting to use PowerPivot and would like to know how to account for values not available when calculating a weighted average.
My data is structured similar to the below
weightsvalues1values2
53.45.8
32.16.7
11.27.1
101.8#N/A
5056.6

<colgroup><col span="3" width="64" style="width: 48pt;"></colgroup><tbody style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit; margin: 0px; outline: 0px; padding: 0px;">
</tbody>
Right now, I have a few DAX formulas built to create weighted average fields for my pivot table.
(1) TotalWeights = sum([weights])
(2) WtdAvgValues1 = sumx(Table1, [values1] * [weights]) / [TotalWeights]
(2) WtdAvgValues2 = sumx(Table1, [values2] * [weights]) / [TotalWeights]

What I'd like PowerPivot to do is exclude the #N/A in value2 when calculating the weighted average (i.e. excluding the #N/A value from the sumproduct numerator and removing the "10" from the sum of the weights).
But of course, PowerPivot is unable to read the column with the #N/A.
Anyone have suggestions on what is the best way to create weighted averages that would account for missing values?
Thanks in advance!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top