Hi,
My Power Pivot data model consists of a number of linked Excel tables, of which tblEvents is the main one. It has the following columns:
As you can see, multiple columns of the main table ought to be related to the same column in the support table tblEmployees, but this isn't allowed in Power Pivot. One potential fix is to add this support table multiple times to the data model, once for every link. However, the reason I am using linked tables is because new rows are regularly added to tblEmployees. This solution is therefore not feasible.
As an alternative, I've been trying to create a measure in tblEmployees which counts, for each employee, the number of rows in the main table (tblEvents) where that employee was involved in any role (Lead, Speaker1, Speaker2, Speaker3, Backup), while preserving pre-existing filter context (e.g. period, event type, client, …).
My attempts so far have all failed miserably. I've tried to modify similar queries I found online, but it seems I simply don't "get" it yet. Any help would be greatly appreciated!
My Power Pivot data model consists of a number of linked Excel tables, of which tblEvents is the main one. It has the following columns:
- Date
- Location, related to the column "LocationName" in tblLocations
- EventType, related to the column "EventType" in tblEventTypes
- Client, related to the column "ClientName" in tblClients
- AudienceSize, a numeric value
- Lead, related to the column "EmployeeName" in tblEmployees
- Speaker1, should be related to the column "EmployeeName" in tblEmployees
- Speaker2, should be related to the column "EmployeeName" in tblEmployees
- Speaker3, should be related to the column "EmployeeName" in tblEmployees
- Backup, should be related to the column "EmployeeName" in tblEmployees
As you can see, multiple columns of the main table ought to be related to the same column in the support table tblEmployees, but this isn't allowed in Power Pivot. One potential fix is to add this support table multiple times to the data model, once for every link. However, the reason I am using linked tables is because new rows are regularly added to tblEmployees. This solution is therefore not feasible.
As an alternative, I've been trying to create a measure in tblEmployees which counts, for each employee, the number of rows in the main table (tblEvents) where that employee was involved in any role (Lead, Speaker1, Speaker2, Speaker3, Backup), while preserving pre-existing filter context (e.g. period, event type, client, …).
My attempts so far have all failed miserably. I've tried to modify similar queries I found online, but it seems I simply don't "get" it yet. Any help would be greatly appreciated!