• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Pivoting daily and static data together

Lionheart

New Member
Hi everyone. Long time stalker, first time poster. I'm a bit brain dead right now and can't figure out how to solve a (probably simple) problem with pivot tables.

I'm using Excel on Office 365 and have created a file with two tables that come from different external sources. I'm using PowerQuery and am pulling data into the file's Data Model in some instances (there is more happening in the file, but this is the relevant stuff).

Table 1: Daily attendance file - every morning, I get an excel file from the front desk which I drop into a sharepoint folder and use Excel to connect to that folder and pull the latest data into a single table. Current have around 35k rows which only contains Employee ID, name and site

Table 2: Full staff list - This is also an external data source where I connect to a file that is created monthly (to update leavers and joiners) and has an entry for every member of staff in the company (contract and permanent) with additional static data such as title, level, department, etc. The Unique identified is of course the Employee ID.

I am currently generating a pivot that shows how many people from any particular department entered any particular building. I've just been asked to turn that whole number into a percentage of the total number of staff (which would change depending on whether there were other filters applied, such as department, manager, city, etc). I tried creating a consolidated range to pull the total population into the Pivot, but that renders my date grouping useless and doesn't work very reliably.

Does anyone here have any suggested approaches I could try to solve this?

Thanks in advance.

EDIT: Additional detail added re: PowerQuery and Data Model
 
I'd recommend uploading sample of your data (both left and right side tables). It would be ideal if you upload workbook with data model. But if unable to, just two tables clearly indicating which column(s) are used as primary and foreign key.
This would make it so much easier for us to help you.
 
I'd recommend uploading sample of your data (both left and right side tables). It would be ideal if you upload workbook with data model. But if unable to, just two tables clearly indicating which column(s) are used as primary and foreign key.
This would make it so much easier for us to help you.
I can't share the original file (too much sensitive data) so I started creating a sample document. The sample doc *worked*! I went back to the original file and removed all the previous stuff I had done and started again. Got it working in the end.

Attaching the sample file for posterity.
 

Attachments

  • Sample Data.xlsx
    204.7 KB · Views: 4
Back
Top