May 02 2018
07:25 PM
- last edited on
Jul 12 2019
11:07 AM
by
TechCommunityAP
May 02 2018
07:25 PM
- last edited on
Jul 12 2019
11:07 AM
by
TechCommunityAP
I'm trying to add a custom field to a pivot table using sumif function.
My data has records for both hours and OT. I would like a pivot table to show the total hours for all types i.e. (Reg, OT, Sick time, etc) . The custom field I need to add would sum all OT hours and divide by the total hours. I'm looking for the best way to do this
May 03 2018 02:08 AM
Hi Jack,
If your table is added to data model you may right click on table name like here
and add measure
=CALCULATE(SUM(Table1[Hours]),Table1[Type]="OT")/CALCULATE(SUM(Table1[Hours]),ALL(Table1[Type]))
or divide on SUM to show % of OT to all other types.
Please see attached.