Forum Discussion
Staff Sharing Sales
- 1 year ago
Gotcha! OK - since that is what you want - here is how I did it... I took your Staff table and added that - then from that I created a dim table with just the Staff name and a dim table of just the rep codes. I then added in your Sales table. I then joined the Staff name dim to Staff table and the Rep Code dim to both the Staff (with a bi-directional join, which should be avoided, but it is needed here) and the Sales table (you would also need a date dim table so you could filter and stuff by dates, but I didn't do that here just to demo). In the visual, I put Staff name from the Staff Dim table and Rep code from the Rep Code dim table and the measure of Sales that I made using the sum of sales from the sales table. Here's the pbix I made: adrian_file
Hii Anonymous
Step 1: Create a Calculated Column in the Staff Table
Staff Count =
VAR CurrentRepCode = Sales[Rep Code]
RETURN
CALCULATE(
DISTINCTCOUNT(Staff[Staff Name]),
Staff[Rep Code] = CurrentRepCode
)
Step 2: Create a Measure for Adjusted Sales Attribution
Sales Attributed =
VAR RepCodeCount =
CALCULATE(
DISTINCTCOUNT(Staff[Staff Name]),
Staff[Rep Code] = SELECTEDVALUE(Sales[Rep Code])
)
RETURN
SUM(Sales[Amount]) / RepCodeCount
If this helps, I would appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!