Thursday, 18 August 2016

Pivot Table - Data Model

Data Model is an in-memory analytics tool introduced by Microsoft since Excel 2013, which can be used to work with disparate data.

Up to this point, we have been working with source data from one table. In reality, users will most likely encounter data from disparate data source. Start from the basic again, in the following example we are working with data source from two tables within the same worksheet:




































The table on the left is a Sales summary, the table on the right is a Salesperson table, we want to group them together to find out the performance of the salespersons.

First, we need to tell Excel their relationship, and then pull them into the internal Data Model.





































Step 1: Click any cell of the Sales Summary table.

Step 2: Go to ribbon, select "Insert"

Step 3: Select "Pivot Table"

Step 4: "Create Pivot Table" dialog box will pop up

Step 5: Select and check the range, select "New Worksheet"

Step 6: Be sure to check next to the "Add this data to the Data Model" => OK








Step 7: Click any cell inside the Salesperson table.

Step 8: Repeat the procedure for the Salesperson     table.

Step 9: On the "Create Pivot Table" dialog box, also check the box next to the "Add this data to the Data Model"







Underneath the "Pivot Table Fields", we can either select "Active" or "All" , we select "All".

"Range" and "Range 1" is the two tables of our source data.

We can click the arrowhead at the left of the table name and select fields from the respective table to incorporate into our new Pivot Table.









We select "Salesperson" to Rows and "Amounts" to Values.

Excel recognises that we are using two tables from our Data Model, and prompts us to create a relationship between them.

To set up the relationship, we click "CREATE"















































In the "Create Relationship" dialog box, we link up the "Customers" from Sales summary table to the "Cust." in the Salesperson table.

Following is the result:


No comments:

Post a Comment