I have two tables
TransactionsTable
InvDate
CustomerName
SalespersonTable
CustomerName
SalesID
SalesPerson
EffectiveFrom
The SalespersonTable has multiple records for the customer - the records are made unique by the SalesID EffectiveFrom columns
Eg
I want to create a column in the TransactionsTable that returns the SalesID and Salesperson from the SalespersonTable based on the CustomerName and the InvDate. The InvDate having to be greater or equal to the EffectiveFrom date. If the customer does not appear in the Salesperson table or there is not a salesperson with an effective from date in relation to the InvDate then UNALLOC should be returned.
Is this possible in PowerPivot?
EG
Results Table (TransactionTable)
[TABLE="class: grid, width: 750, align: left"]TransactionsTable
InvDate
CustomerName
SalespersonTable
CustomerName
SalesID
SalesPerson
EffectiveFrom
The SalespersonTable has multiple records for the customer - the records are made unique by the SalesID EffectiveFrom columns
Eg
I want to create a column in the TransactionsTable that returns the SalesID and Salesperson from the SalespersonTable based on the CustomerName and the InvDate. The InvDate having to be greater or equal to the EffectiveFrom date. If the customer does not appear in the Salesperson table or there is not a salesperson with an effective from date in relation to the InvDate then UNALLOC should be returned.
Is this possible in PowerPivot?
EG
Results Table (TransactionTable)
<tbody style="border-collapse: collapse; width: auto;">[TR]
[TD]InvDate
[/TD]
[TD]CustomerName
[/TD]
[TD]Amount
[/TD]
[TD]SalesID
[/TD]
[TD]SalesPerson
[/TD]
[/TR]
[TR]
[TD]01/02/2018
[/TD]
[TD]ACME
[/TD]
[TD]100.00
[/TD]
[TD]RA
[/TD]
[TD]Rob Anderson
[/TD]
[/TR]
[TR]
[TD]28/02/2018
[/TD]
[TD]ACME
[/TD]
[TD]300.00
[/TD]
[TD]ST
[/TD]
[TD]Ste Trueman
[/TD]
[/TR]
[TR]
[TD]28/12/2017
[/TD]
[TD]ACME
[/TD]
[TD]500.00
[/TD]
[TD]UNALLOC
[/TD]
[TD]Unallocated
[/TD]
[/TR]
</tbody>[/TABLE]
Salesperson Table
[TABLE="class: grid, width: 500, align: left"]<tbody style="border-collapse: collapse; width: auto;">[TR]
[TD]CustomerName
[/TD]
[TD]SalesID
[/TD]
[TD]SalesPerson
[/TD]
[TD]EffectiveFrom
[/TD]
[/TR]
[TR]
[TD]ACME
[/TD]
[TD]RA
[/TD]
[TD]Rob Anderson
[/TD]
[TD]01/01/2018
[/TD]
[/TR]
[TR]
[TD]ACME
[/TD]
[TD]ST
[/TD]
[TD]Ste Trueman
[/TD]
[TD]28/02/2018
[/TD]
[/TR]
</tbody>[/TABLE]
Transaction Table
[TABLE="class: grid, width: 500, align: left"]<tbody style="border-collapse: collapse; width: auto;">[TR]
[TD]InvDate
[/TD]
[TD]CustomerName
[/TD]
[TD]Amount
[/TD]
[/TR]
[TR]
[TD]01/02/2018
[/TD]
[TD]ACME
[/TD]
[TD]100.00
[/TD]
[/TR]
[TR]
[TD]28/02/2018
[/TD]
[TD]ACME
[/TD]
[TD]300.00
[/TD]
[/TR]
[TR]
[TD]28/12/2017
[/TD]
[TD]ACME
[/TD]
[TD]500.00[/TD]
[/TR]
</tbody>[/TABLE]