Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DavidData
Frequent Visitor

Having trouble with percentiles!

Hello everyone, I'm having a bit of trouble making an idea work, I want one column that classifies a list of "agents" in different quartiles(Q1,Q2,Q3,Q4), I've read all around to forum but I just cant get it to work.

 

My data sources are:
A) "DatosAgentes" with all the personal info from the agents

B) "bruto_llamadas", that connects to MySQL, inside B is a list of calls, with the AHT(Average Handling Time) and the Agent identifier or "Login", 

 

Example data:

A: 

LOGINAGENT
76000DAVID
76001CARLOS
76002MARIO
76003ARANTXA
76004MARIA
76005

MACARENA

 

B)

UCID(UNIQUE IDENTIFIER)AGENTAHTDATE
CALL NUMBER 17600148504/11/2020
CALL NUMBER 27600723218/10/2020
CALL NUMBER 37600333931/08/2020
CALL NUMBER 47600014327/10/2020
CALL NUMBER 57600348028/08/2020
CALL NUMBER 67600223411/09/2020
CALL NUMBER 77600024806/11/2020
CALL NUMBER 87600537910/09/2020
CALL NUMBER 97600241217/10/2020
CALL NUMBER 107600031417/09/2020
CALL NUMBER 117600745214/09/2020
CALL NUMBER 127600624228/08/2020
CALL NUMBER 137600548116/08/2020
CALL NUMBER 147600230108/09/2020
CALL NUMBER 157600737413/08/2020
CALL NUMBER 167600319008/08/2020
CALL NUMBER 177600122606/10/2020
CALL NUMBER 187600114519/10/2020
CALL NUMBER 197600720322/08/2020
CALL NUMBER 207600320104/11/2020
CALL NUMBER 217600030106/09/2020
CALL NUMBER 227600718304/09/2020
CALL NUMBER 237600116707/10/2020
CALL NUMBER 247600043907/09/2020

 

Inside (A) I calculate the average AHT(and even more KPIs) with this formula "CALCULATE(AVERAGE(bruto_llamadas[TMO-1]),ALL(bruto_llamadas[TMO-1]))" inside TMO-1 are only the call durantions from the current month.

 

My desired result is like this:

AGENTAHT(AVG)Q
DAVID2891
CARLOS2561
MARIO3163
ARANTXA3032
MARIA0-
MACARENA4304

 

I want to classify the agents in 4 different Q depending on their average TMO-1.

Can you help me?

 

Thanks.

1 ACCEPTED SOLUTION

You're looking for this???

littlemojopuppy_0-1605558537533.png
You can download the Excel file...the measures are in Power Pivot.

Editing post acceptance to include the measures:

 

Agent Average Handling Time:=AVERAGEX(
	Agents,
	[Average Handling Time]
)


Agent 1st Quartile:=PERCENTILEX.INC(
	ALL(Agents),
	[Agent Average Handling Time],
	.25
)


Agent Quartile Bucket:=SWITCH(
		TRUE(),
		[Agent Average Handling Time] <= [Agent 1st Quartile], "1st",
		AND(
			[Agent Average Handling Time] > [Agent 1st Quartile],
			[Agent Average Handling Time] <= [Agent 2nd Quartile]
		), "2nd",
		AND(
			[Agent Average Handling Time] > [Agent 2nd Quartile],
			[Agent Average Handling Time] <= [Agent 3rd Quartile]
		), "3rd",
		AND(
			[Agent Average Handling Time] > [Agent 3rd Quartile],
			[Agent Average Handling Time] <= [Agent 4th Quartile]
		), "4th",
		BLANK()
	)

 

 

View solution in original post

10 REPLIES 10
littlemojopuppy
Community Champion
Community Champion

@DavidData download the file again from the link above and take a look 🙂

littlemojopuppy
Community Champion
Community Champion

That was my bad...put the table inside the ALL() function.

So to get to the desired output you're going to need another measure that looks at an agent's AHT and compares it to the quartile values and then assigns Q1, Q2, etc.  Something along the lines of this...

SWITCH()
	TRUE(),
	[Agent AHT] < [1st Quartile], "Q1",
	AND
		[Agent AHT] >= [1st Quartile],
		[Agent AHT] < [2nd Quartile
	), "Q2",
	AND
		[Agent AHT] >= [2nd Quartile],
		[Agent AHT] < [3rd Quartile
	), "Q3",
	AND
		[Agent AHT] >= [3rd Quartile],
		[Agent AHT] < [4th Quartile
	), "Q4",
	BLANK()
)

Sorry, maybe I've explained wrongly. I know I will have to compare each agent's aht with the different Q inside the table, but the problem is that when I calculate the quartiles the calculation is made inside each agent.

You're looking for this???

littlemojopuppy_0-1605558537533.png
You can download the Excel file...the measures are in Power Pivot.

Editing post acceptance to include the measures:

 

Agent Average Handling Time:=AVERAGEX(
	Agents,
	[Average Handling Time]
)


Agent 1st Quartile:=PERCENTILEX.INC(
	ALL(Agents),
	[Agent Average Handling Time],
	.25
)


Agent Quartile Bucket:=SWITCH(
		TRUE(),
		[Agent Average Handling Time] <= [Agent 1st Quartile], "1st",
		AND(
			[Agent Average Handling Time] > [Agent 1st Quartile],
			[Agent Average Handling Time] <= [Agent 2nd Quartile]
		), "2nd",
		AND(
			[Agent Average Handling Time] > [Agent 2nd Quartile],
			[Agent Average Handling Time] <= [Agent 3rd Quartile]
		), "3rd",
		AND(
			[Agent Average Handling Time] > [Agent 3rd Quartile],
			[Agent Average Handling Time] <= [Agent 4th Quartile]
		), "4th",
		BLANK()
	)

 

 

EDIT: Sorry, didnt check the file, I'm checking how you've made it work in excel, didnt even know you could do that kind of formula inside Excel. Thanks

 

Okey... so.. its partly working, it does keep the same value between agents, so thats a plus, but now one thing I didnt specify at the beginning, I do apply filters to the data, like what service does the call come from and I need the Q to respect the filters,

 

From what I've seen so far it calculates the quartiles of all the calls, not just the ones I've got selected in the filter. How can I make it work like that?

Hi!  I didn't see this response until now.  Apologize for the delay 😔

The percentile calculations use the ALL function in them.  Change ALL to ALLEXCEPT and include the fields you want to filter by.  For example ALLEXCEPT('Handing Times', [Date])

Sorry to bother you again, now it IS calculating with the correct data(thanks for the tip with allexcept, its working!) but I dont know why the number of agents per Q is not the same, when doing percentiles, well, quartiles, all 4 of them have to be the same size.

If you need me to send you the file or to screenshot all the formulas.. i dont mind if the file is kept private.

Current result:

DavidData_0-1605691573990.png

Desired result:

DavidData_0-1605691993646.png

Have to say even if its not working right now as I wanted, thanks for all your help @littlemojopuppy and patience, I come from an only excel enviroment and I've been trying with curses to make PowerBI work for me...

Ok...the calculations were dividing the calls into percentile buckets based on time, not the agents...let me modify calcs.  Will let you know when you can download the file again.

littlemojopuppy
Community Champion
Community Champion

Unless I'm missing something, wouldn't this work?

PERCENTILEX.EXC(
Agents,
[Average AHC],
-- First Quartile, modify as appropriate for others
.25
)

https://docs.microsoft.com/en-us/dax/percentilex-exc-function-dax

Thats what I though, but when I input that formula it displays the first quartile for each agent. (Cuartil = Q)

Captura.JPG

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.