Calculting averages based on groups

JEmas

New Member
Joined
Jan 8, 2014
Messages
5
Hi,
I am trying to calculate the average bill amount for a based on services utilized. I have 3 columns each representing a different service and a total bill amount column containing the total bill amount for the row. I want to know the average bill amount for only individuals whom received services. Therefore, I only want the total bill amount/total quantity of services if >0. I want to integrate these results to a powermap, however, because not every row has a value, I cannot use the average function in powermap as it will provide a sum/total rows. Furthermore some bill amounts are comprised of multiple services so dividing by row count will be inaccurate. Unless there is a way to add custom formulas to powermap, I think this will have to be done in the powerpivot. Is there a way to apply the below formula to every zip code without witting every zip code?


THis is what I have so far
=CALCULATE(SUM('zip codes'[BILL_AMT]),'zip codes'[Total Visits]>0)/CALCULATE(SUM('zip codes'[Total Visits]),'zip codes'[Total Visits]>0)

Also, the 'Total Visits' column is comprised of the 3 service type columns.
Any help would be greatly appreciated.
Thanks
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,223,989
Messages
6,175,812
Members
452,671
Latest member
jowalker82

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