Forum Discussion
Pivot Table with Multiple Dates
- Oct 07, 2023
Creating PivotTable add data to data model
Add Name to Rows.
In PivotTable pane right click on table name and Add measure
add measures one by one
Finalize PivotTable with them
Hi DeejayJohn,
You can try these steps to make a Pivot table with multiple dates:
Step 1: Create a new pivot table
- Select the data that you want to include in the pivot table.
- Click the Insert tab.
- In the Tables group, click PivotTable.
- In the Create PivotTable dialog box, select the New Worksheet option.
- Click OK to create the pivot table.
Step 2: Add the required fields to the pivot table
- Drag the NAME field to the Row Labels area of the pivot table.
- Drag the STATUS field to the Filters area of the pivot table.
- In the Filters area, click the All checkbox next to the STATUS field.
- Clear the checkbox next to the Inactive status.
- Click OK to apply the filter.
- Drag the ARRIVAL DATE field to the Values area of the pivot table.
- Change the value calculation for the ARRIVAL DATE field to Maximum.
- Drag the MAN-DAYS field to the Values area of the pivot table.
- Change the value calculation for the MAN-DAYS field to Sum.
Step 3: Calculate the total number of man-days consumed to date
To calculate the total number of man-days consumed to date, you can use the following calculated field:
Total Man-Days Consumed to Date =
IF([STATUS] = "Active", [MAX of ARRIVAL DATE] + [MAN-DAYS], [MAN-DAYS])
This calculated field will return the total number of man-days consumed to date, even for workers who are still active.
To add this calculated field to the pivot table, follow these steps:
- Click the PivotTable Analyze tab.
- In the Calculations group, click Calculated Field.
- In the Calculated Field dialog box, enter the following information:
- Name: Total Man-Days Consumed to Date
- Formula: IF([STATUS] = "Active", [MAX of ARRIVAL DATE] + [MAN-DAYS], [MAN-DAYS])
- Click OK to add the calculated field to the pivot table.
- Drag the Total Man-Days Consumed to Date field to the Values area of the pivot table.
Step 4: Remove the duplicate rows
To remove the duplicate rows from the pivot table, you can use the following filter:
- In the PivotTable Analyze tab, click the Filter button.
- In the Filters pane, click the Total Man-Days Consumed to Date field.
- In the Filter dialog box, click the Unique Values checkbox.
- Click OK to apply the filter.
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.
If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)
Thanks. I got an idea on what steps to follow.
I'm just having problem on the formula in calculated field.