Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Dynamic Allocation from different table

I am trying to create a table or table visual that accomplishes the following, but cannot figure out either the measures/calculations needed to create it. There is an 'opportunity' by Rep table and a...
  • bhanu_gautam's avatar
    1 year ago

    Anonymous 

    Make sure there is a relationship between the 'Division' columns in both tables.

    Calculate the monthly target for each rep by dividing the division's monthly target by the number of active reps in that division for each month.

    DAX
    Mo Target =
    VAR ActiveReps =
    CALCULATE(
    DISTINCTCOUNT('opportunity'[Rep]),
    ALLEXCEPT('opportunity', 'opportunity'[Division], 'opportunity'[Closed Date])
    )
    RETURN
    DIVIDE(
    MAX('target'[Div_Mo_Target]),
    ActiveReps,
    0
    )

     

    Calculate the number of opportunities closed by each rep for each month.

    DAX
    Jan-25 =
    CALCULATE(
    COUNT('opportunity'[Opportunity]),
    MONTH('opportunity'[Closed Date]) = 1,
    YEAR('opportunity'[Closed Date]) = 2025
    )

    Feb-25 =
    CALCULATE(
    COUNT('opportunity'[Opportunity]),
    MONTH('opportunity'[Closed Date]) = 2,
    YEAR('opportunity'[Closed Date]) = 2025
    )

     

    Add a Matrix visual to your report.
    Drag 'Division' and 'Rep' to the Rows.
    Drag the measures 'Mo Target', 'Jan-25', and 'Feb-25' to the Values.
    Ensure that the matrix is set to show subtotals and grand totals.