I have a concern/inquiry about how to apply monthly level "sales target" on a daily, or weekly level. Right now I have a separate "SalesTarget" table which does not really have a primary key because they are redundant, due to having different sales target for different month.
For example:
1. "salesperson": 10, "Start of Month": 2023-01-01, "Monthly Target": $30000, "Daily Target": $1500
2. "salesperson": 20, "Start of Month": 2023-01-01, "Monthly Target": $50000, "Daily Target": $2000
3. "salesperson": 10, "Start of Month": 2023-02-01, "Monthly Target": $40000, "Daily Target": $1600
4. "salesperson": 20, "Start of Month": 2023-02-01, "Monthly Target": $60000, "Daily Target": $2500
...
(Which means both keys "salesperson" and "Month", are not unique)
My relationship model looks like the following:
In this model, -salesperson connects to salesbudget on salesperson_id (1-many) -calendar connects to salesbudget (1-many) on left = 'full_date', right = 'start of month'
Visual:
Problem: 2. When I select on a daily or weekly level, its not showing up the targets since there is only relationship on the "start of month" but not only other dates.
Potential solution:
Question: Is there a better way to achieve this goal? Thank you!
You can try this for always starting at the start of the month.
Budget =
CALCULATE(
SUM(SalesBudget[Monthly_Budget]),
DATESBETWEEN(
calender[full_date],
STARTOFMONTH(calender[full_date]),
MAX(calender[full_date])
)
)