Forum Discussion
Perfomance based on Quartile
I have the attriton Data based on Team Manager and country. I need to find the quartile and based on that we need to see whcih quartile the TM falls under. Fotr this i need a formula that will calculate MIN ,MAX,25,50& 70 Quartile based on country.Fox example We need to calculate the Quartile for Australia(MIN ,MAX,25,50& 70) and based on this we need to know wer the Australian TM falls under. The catogarisation is based on the flllowing.
MIN-25th quartile =Top Quartile, 25th-50th=50th Quartile,50-75=75th Quartile,75-MAX=Bottom Quartile.
Below is the sample data.
| Team Manager | Country | Att% |
| Rothery, Dylan | AUSTRALIA | 0% |
| Van Zutphen, Michael | AUSTRALIA | 0% |
| Coward, Thomas | AUSTRALIA | 0% |
| Rafter, James | AUSTRALIA | 0% |
| Wake, Cameron | AUSTRALIA | 0% |
| Farquhar, Tayler | AUSTRALIA | 0% |
| Peters, Stacey | AUSTRALIA | 0% |
| Dodge, Timothy | AUSTRALIA | 0% |
| Holden-Schulz, Brooke | AUSTRALIA | 0% |
| Gaerlan, Manuel | AUSTRALIA | 0% |
| Clifton, Jacqueline | AUSTRALIA | 0% |
| Moncrieff, Lisa | AUSTRALIA | 0% |
| Flello, Kelly Denise | AUSTRALIA | 0% |
| Kerr, Michael | AUSTRALIA | 0% |
| Tamaiparea, Kimiora | AUSTRALIA | 0% |
| Glasse, Shannon | AUSTRALIA | 0% |
| Leeson, Tricia | AUSTRALIA | 0% |
| Berry, Susan | AUSTRALIA | 0% |
| Watkinson, Casey | AUSTRALIA | 0% |
| Neild, David | AUSTRALIA | 0% |
| Nyamayaro, Munyaradzi | AUSTRALIA | 0% |
| Schoeman, Dominique | AUSTRALIA | 0% |
| Aho, Talitha | AUSTRALIA | 0% |
| Slattery, Thomas | AUSTRALIA | 5% |
| Auboire, Ashley | AUSTRALIA | 6% |
| Baxter, Aurora | AUSTRALIA | 6% |
| Sgualdino, Adriano | AUSTRALIA | 6% |
| Dollin, Ellen | AUSTRALIA | 7% |
| Subbaroo, Punetha | AUSTRALIA | 9% |
| Harwood, Justin | AUSTRALIA | 9% |
| Woodfield, Lauren | AUSTRALIA | 12% |
| Moghaddam, Anthony | AUSTRALIA | 12% |
| Lyall-Lawrence, CNedra | AUSTRALIA | 15% |
| Hosking-Thompson, Kelsey | AUSTRALIA | 16% |
| Najarro, Gabriel | AUSTRALIA | 20% |
| Skinner, Krista | AUSTRALIA | 24% |
| Degoumois, Jacqueline | AUSTRALIA | 24% |
| John Peter, Nirosan Jude | AUSTRALIA | 27% |
| Munday, Karen | AUSTRALIA | 39% |
| Duarte, Bruno Vieira | BRAZIL | 23% |
| Silva, Tamara | BRAZIL | 5% |
| Silva, Ivan Cirino | BRAZIL | 10% |
| Ferlini, Thiago Do Nascimento | BRAZIL | 7% |
| Bonifazio, Anderson | BRAZIL | 34% |
| Ceccon, Dayane | BRAZIL | 5% |
| Silva, Haschle Nascimento | BRAZIL | 0% |
| Santos, Albert Wesley Oliveira | BRAZIL | 67% |
| Da Silva, Gabriel Lima | BRAZIL | 0% |
| Pelinson, Leonardo | BRAZIL | 0% |
| Santana, Evair | BRAZIL | 23% |
| CAVALCANTE, CLAUDIA DA SILVA | BRAZIL | 7% |
| Lima, Liliane Maria | BRAZIL | 0% |
| Pereira, Juliana Alves | BRAZIL | 1% |
| Faber, Larissa Vieira Da Silva | BRAZIL | 7% |
| Gomes, Leonardo Jose | BRAZIL | 0% |
| Menezes, Felipe Alexandre | BRAZIL | 5% |
| De Brito, Thiago Lazaro Correia | BRAZIL | 0% |
| Pena, Bruno | BRAZIL | 0% |
- Anonymous6 years ago
Hi unnijoy ,
You can also use the attached file for Visulaization.
https://drive.google.com/open?id=12XyFQmI9bZpSXy08lgMc8EpVuwQQ42ZG
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!
17 Replies
- Greg_Deckler
Community Champion
Hmm, I just checked my project and no solution for QUARTILE yet. Maybe I'll try to hammer one out and kill two birds with one stone. Is this source data we are looking at?
https://community.powerbi.com/t5/Community-Blog/P-Q-Excel-to-DAX-Translation/ba-p/1061107
- AnonymousNot applicable
It's very easy.
For quartiles, you can either use the DAX functions PERCENTILE.EXC or PERCENTILE.INC or, if you want to get your hands dirty and keep your head busy, you can familiarize yourself with this page:
https://www.daxpatterns.com/statistical-patterns/
This is more than enough information for you to be able to create what you need.
Best
D
- Greg_Deckler
Community Champion
After going through this excercise, I'm not sure I trust Excel's QUARTILE function and by proxy PERCENTILE.INC and PERCENTILE.EXC they seem to come up with different results than everything else I have read on Quartiles...
- AnonymousNot applicable
Hi unnijoy ,
You will need to create Calculated Columns.
Percentile.75 = IF(Quartiles[Country] = "AUSTRALIA", (CALCULATE(PERCENTILE.EXC(Quartiles[Att%],.75),FILTER(Quartiles, Quartiles[Country] = "AUSTRALIA"))),(CALCULATE(PERCENTILE.EXC(Quartiles[Att%],.75),FILTER(Quartiles, Quartiles[Country] = "BRAZIL"))))Percentile.5 = IF(Quartiles[Country] = "AUSTRALIA", (CALCULATE(PERCENTILE.EXC(Quartiles[Att%],.5),FILTER(Quartiles, Quartiles[Country] = "AUSTRALIA"))),(CALCULATE(PERCENTILE.EXC(Quartiles[Att%],.5),FILTER(Quartiles, Quartiles[Country] = "BRAZIL"))))Percentile.25 = IF(Quartiles[Country] = "AUSTRALIA", (CALCULATE(PERCENTILE.EXC(Quartiles[Att%],.25),FILTER(Quartiles, Quartiles[Country] = "AUSTRALIA"))),(CALCULATE(PERCENTILE.EXC(Quartiles[Att%],.25),FILTER(Quartiles, Quartiles[Country] = "BRAZIL"))))Category =SWITCH(TRUE(),Quartiles[Att%] < Quartiles[Percentile.25] , "Top Quartile",(Quartiles[Att%] >= Quartiles[Percentile.25]) && (Quartiles[Att%] < Quartiles[Percentile.5]) , "25th to 50th Quartile",(Quartiles[Att%] >= Quartiles[Percentile.5]) && (Quartiles[Att%] < Quartiles[Percentile.75]) , "50th to 75th Quartile","Bottom Quartile")Drag and Drop the Category Column to get the desired results.You can also see difference between Percentile.INC and Percentile.EXC in the below post.Regards,Harsh NathaniDid I answer your question? Mark my post as a solution! Appreciate with a Kudos!!- unnijoy
Post Prodigy
hi Anonymous
thanks for the help.
can you please help me to modify the formula in such a way that if i have more country. lets say 100 countries. In that situation how to modify this formula.
I need to find Min and MAX also.
Top Quartile = Attrition % Between MIN and <=25th Quartile
50th Quartile = > 25th Quartile <= 50th Quartile
75th Quartile=>50th Quartile and <=75th Quartile
Bottom = >75th Quartile and <= MAX
Please help me to get the formula to match this.
Thanks again for your help.
- AnonymousNot applicableYou also have to state if you want a relative or absolute calculation.
Best
D
- AnonymousNot applicable
Hi unnijoy ,
Can you confirm if you are looking at the category values based on the Quaritle25,Quartile50, Quartile75 of that specific country.
Regards,
Harsh Nathani
- unnijoy
Post Prodigy
hi Anonymous
yes but in that we need to add MIN (attr%)and MAX(Attr%).
So it will be like MIN,Quaritle25,Quartile50, Quartile75,MAX
Your above formula is correct.
But that is filtered to only 2 country. Can you modify that in such a way that it can be used on multiple country. We have arround 50 countries.
And can you please attach the PBX file also. So that it will be helpfull.