Hi All,
I have been at this issue for the last three days and have not got anywhere.
The issue:
I have a two datasets of payroll data, one with hours worked on a daily basis and the second one the employee details and the number of hours expected to work in a given week.
This data is in PowerPivot, and I have created a Pivot Table that shows the sum of the Hrs Worked. The user has a slicer on Date so they can select the required date/s (anywhere from one day to n months).
The issue is I need to show in the Pivot Table the sum of Hrs Target and the difference between Sum of Hrs Worked and sum of Hrs Target.
Note: The calculation for sum of Hrs Target is NETWORKDAYS(<First Date Selected>, <Last Date Selected>)/5 * Weekly Hrs Target (of each employee)
Once I show these columns I then need to filter (possibly with a slicer) the records that have a difference of <0.
I've been able to calculate the NETWORKDAYS(<First Date Selected>, <Last Date Selected>)/5 from the slicer and store it in a named range, but I cannot work out how to pass that value back to the PowerPivot. If I knew that, I would create a calculation on each employee in the Hours Worked table.
Example Data:
Hours Worked
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Emp ID[/TD]
[TD]Date[/TD]
[TD]Hrs Worked[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]31/3/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1/4/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2/4/2014[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]3/4/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]31/3/2014[/TD]
[TD]7.5[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1/4/2014[/TD]
[TD]7.5[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3/4/2014[/TD]
[TD]7.5[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]31/3/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1/4/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2/4/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]3/4/2014[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
Employee Data
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Emp ID[/TD]
[TD]Weekly Hrs Target[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]40[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]37.5[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]37.5[/TD]
[/TR]
</tbody>[/TABLE]
Any help will be appreciated.
Thank you on advance.
I have been at this issue for the last three days and have not got anywhere.
The issue:
I have a two datasets of payroll data, one with hours worked on a daily basis and the second one the employee details and the number of hours expected to work in a given week.
This data is in PowerPivot, and I have created a Pivot Table that shows the sum of the Hrs Worked. The user has a slicer on Date so they can select the required date/s (anywhere from one day to n months).
The issue is I need to show in the Pivot Table the sum of Hrs Target and the difference between Sum of Hrs Worked and sum of Hrs Target.
Note: The calculation for sum of Hrs Target is NETWORKDAYS(<First Date Selected>, <Last Date Selected>)/5 * Weekly Hrs Target (of each employee)
Once I show these columns I then need to filter (possibly with a slicer) the records that have a difference of <0.
I've been able to calculate the NETWORKDAYS(<First Date Selected>, <Last Date Selected>)/5 from the slicer and store it in a named range, but I cannot work out how to pass that value back to the PowerPivot. If I knew that, I would create a calculation on each employee in the Hours Worked table.
Example Data:
Hours Worked
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Emp ID[/TD]
[TD]Date[/TD]
[TD]Hrs Worked[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]31/3/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1/4/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2/4/2014[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]3/4/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]31/3/2014[/TD]
[TD]7.5[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1/4/2014[/TD]
[TD]7.5[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3/4/2014[/TD]
[TD]7.5[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]31/3/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1/4/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]2/4/2014[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]3/4/2014[/TD]
[TD]8[/TD]
[/TR]
</tbody>[/TABLE]
Employee Data
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Emp ID[/TD]
[TD]Weekly Hrs Target[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]40[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]37.5[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]37.5[/TD]
[/TR]
</tbody>[/TABLE]
Any help will be appreciated.
Thank you on advance.