Forum Discussion

SUTChepe's avatar
SUTChepe
Frequent Visitor
2 years ago
Solved

Percentile Calculation - from Individual evaluations to agent performance

Im trying to create a Quartile calculation for a Data coming from couple of thousand evaluations, the data comes 1 line per evaluation and I just do a simple average to calcualte the average score: ...
  • AlexisOlson's avatar
    2 years ago

    I suspect the problem is that [Q4] is being evaluated within the filter context of the Agent Number.

     

    Try removing the visual's filter context with ALLSELECTED:

    Q4 =
    VAR _Table =
        CALCULATETABLE (
            SUMMARIZE ( Append1, Append1[Agent Number], "@Score", [Score] ),
            ALLSELECTED ()
        )
    RETURN
        PERCENTILEX.INC ( _Table, [@Score], 0.25 )

     

    Side note: you can use a SWITCH instead of nested IFs:

    Agent Quartile =
    SWITCH (
        TRUE (),
        [Score] < [Q4], "Q4",
        [Score] < [Q3], "Q3",
        [Score] < [Q2], "Q2",
        [Score] < [Q1], "Q1",
        "Check"
    )