Calculated field to show subtotal value

bthomas

Board Regular
Joined
Mar 4, 2008
Messages
139
I could be going about this all wrong and this may be why I am unable to find any information on this topic, but I am trying to create a calculated field that gives the subtotal value in a column. My ultimate goal is to get the percent of the subtotal value for each item.

I created a simple table named Grades (for learning Power Pivot). The table has the following fields.

Type
First
Last
Current Points
Total Points

I would like to create a column that totals the Current Points based on Type.

My current table looks like the example below with the calculation scenarios added. When I create the Current Points formula based on Type, it repeats the Current Points column. This is the formula I am using.

By Type:=CALCULATE([Total],Grades[Type]=Grades[Type])

Please let me know if you have any suggestions. Your help is greatly appreciated!

TypeFirstLastCurrent PointsTotal PointsThe calculation I would like.The calculation I am getting.
FemaleShaunaThomas4001000650400
MaleLoganThomas3501000550350
MaleJayShaw2001000550200
FemaleWendyDem2501000650250

<tbody>
</tbody>
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Create a Measure [TotalCurrentPoints] =SUM(Grades[Current Points])

Create a Column:

=CALCULATE(CALCULATE([TotalCurrentPoints];ALL(Grades);VALUES(Grades[Type])))

You need two calculate for context transition and values to filter for type. Also need all to get the whole table.

I hope it helps.
 
Upvote 0
Create a Measure [TotalCurrentPoints] =SUM(Grades[Current Points])

Create a Column:

=CALCULATE(CALCULATE([TotalCurrentPoints];ALL(Grades);VALUES(Grades[Type])))

You need two calculate for context transition and values to filter for type. Also need all to get the whole table.

I hope it helps.

PS: Just change the ";" for ","
 
Upvote 0

Forum statistics

Threads
1,214,872
Messages
6,122,025
Members
449,060
Latest member
LinusJE

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