% of Total

stbrooks13

New Member
Joined
Dec 9, 2014
Messages
40
This sounds so easy!

I have a table containing my number of hired interns and associates by year and by school. Then I have a table containing how much we paid each school by year.

I'm trying to come up with a DAX formula that takes the total paid to the school and divide it by the % of total interns and associates on the PowerPivot table. But, the total amount paid to the school is showing in both the intern and associate columns.

For instance, if we paid $100 to a school, and hired 7 interns and 3 associates, I want $70 to show as going towards the interns and $30 to show as going towards the interns.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
You've not had a reply so thought I would post (I'm super new to this and I'm positive someone could post a proper measure!!)

I can only get this to work by including a count of Interns and Associates in the Pivot.

Assuming the following Tables:

dTypes

Excel 2010
ABCD
1TypeSchoolYear
2InternA2015
3AssociateA2015
4InternA2015
5AssociateA2015
6InternA2015
7InternB2015
8InternB2015
9InternB2015
10AssociateB2015
11InternA2016
12AssociateA2016
13InternA2016
14AssociateB2016
15InternB2016
16InternB2016
17InternB2016
18InternB2016
19AssociateB2016
Sheet1


tFact

Excel 2010
GHIJ
1SchoolYearPaid
2A2015125
3B2015200
4A2016135
5B2016240
Sheet1


dSchools

Excel 2010
E
2Schools
3A
4B
5
Sheet1


dYears

Excel 2010
E
7Years
82015
92016
10
Sheet1


Measure in dTypes
CountTypes:=COUNTA([Type])

Measure in tFact
TotalPaid:=SUM(tFact[Paid])

Rg4BhjL.jpg


9byWO3Q.jpg
 
Upvote 0
Remove 'CountTypes' from the Pivot and update the TotalPaid Measure to:

=SUM(tFact[Paid])*(dTypes[CountTypes]/CALCULATE(dTypes[CountTypes], All(dTypes[Type])))

This appears to work.


Excel 2010
BCDEF
3TotalPaid
4SchoolsYearsTypeTotal
5A2015Associate£50.00
6Intern£75.00
72015 Total£125.00
82016Associate£45.00
9Intern£90.00
102016 Total£135.00
11A Total£260.00
12B2015Associate£50.00
13Intern£150.00
142015 Total£200.00
152016Associate£80.00
16Intern£160.00
172016 Total£240.00
18B Total£440.00
19Grand Total£700.00
20
Sheet4
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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