Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all,
after finding some great info on this forum, here's my first topic. My first part of this problem succeeded because of other topics I found, but I'm now running into an issue that I can not solve.
My data-set consists of a table with employees and their coaching data. Based on several columns, I have added a measure to calculate the 'Pass Rate'.
I have created a measure that will calculate the percentiles for 25, 50 and 75, and then returns a text for whatever wuartile their pass rate falls in:
Quartile =
var p25 = PERCENTILEX.INC(SUMMARIZE(ALLSELECTED(myTable,[Employee Name],"Pass Rate",[(%) Pass Rate]),[Pass Rate],0.25)
var p50 = PERCENTILEX.INC(SUMMARIZE(ALLSELECTED(myTable),[Employee Name],"Pass Rate",[(%) Pass Rate]),[Pass Rate],0.5)
var p75 = PERCENTILEX.INC(SUMMARIZE(ALLSELECTED(myTable),[Employee Name],"Pass Rate",[(%) Pass Rate]),[Pass Rate],0.75)
return IF([(%) Pass Rate]>=p75,"Quartile 1",IF([(%) Pass Rate]>=p50,"Quartile 2",IF([(%) Pass Rate]>=p25,"Quartile 3","Outliers")))
This was a personal break-through after several nights of reading and trying. I now have a nice table like:
Employee Name | (%) Pass Rate | Quartile |
Emp1 | 100% | Quartile 1 |
Emp2 | 90% | Quartile 2 |
Emp3 | 30% | Outliers |
Next step is to create a small graph with the count of employees per Quartile, however. I can not use my Quartile measure in the Axis part of the graph. I tried to use the same calculation but now as a Column instead of a measure, this results in the graph only displaying 'Quartile 2', probably because it's not yet grouped by Employee Name?
I also tried to create a column like so:
Quartile_text = switch([QuartileNumber],1,"1",2,"2",3,"3",4,"4")
but this also returns only "2"
What would be the approach to get a 'Quartile Text' column/measure that I can use in a graph Axis, that shows all Quartiles that are also in the 'Employee Table'?
Solved! Go to Solution.
@Remco1986 , refer if these can help
https://blog.enterprisedna.co/implementing-80-20-logic-in-your-power-bi-analysis/
https://forum.enterprisedna.co/t/testing-the-pareto-principle-80-20-rule-in-power-bi-w-dax/459
https://finance-bi.com/power-bi-pareto-analysis/
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Calculate-the-sum-of-the-top-80/td-p/763156
HI @Remco1986 ,
Here is a very nice article on how you can use a measure as an axis:
https://radacad.com/dax-measure-in-the-axis-of-the-power-bi-report
Thanks,
Pragati
@Remco1986 , refer if these can help
https://blog.enterprisedna.co/implementing-80-20-logic-in-your-power-bi-analysis/
https://forum.enterprisedna.co/t/testing-the-pareto-principle-80-20-rule-in-power-bi-w-dax/459
https://finance-bi.com/power-bi-pareto-analysis/
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Calculate-the-sum-of-the-top-80/td-p/763156
@amitchandak thanks, these links were very usefull.
I have now made a table (called 'quartileMap' with the Quartile texts and the sort-order:
quartileName | sortOrder |
Quartile 1 | 1 |
Quartile 2 | 2 |
Quartile 3 | 3 |
Outliers | 4 |
Next, I created a measure:
Test =
SWITCH(SELECTEDVALUE(quartileMap[quartileName]),
"Quartile 1", COUNTROWS(filter(SUMMARIZE(ALLSELECTED(myTable),[Employee Name],"Quartile",[Quartile]),[Quartile]="Quartile 1")),
"Quartile 2", COUNTROWS(filter(SUMMARIZE(ALLSELECTED(myTable),[Employee Name],"Quartile",[Quartile]),[Quartile]="Quartile 2")),
"Quartile 3", COUNTROWS(filter(SUMMARIZE(ALLSELECTED(myTable),[Employee Name],"Quartile",[Quartile]),[Quartile]="Quartile 3")),
"Outliers", COUNTROWS(filter(SUMMARIZE(ALLSELECTED(myTable),[Employee Name],"Quartile",[Quartile]),[Quartile]="Outliers"))
)
I can now create a bar graph with the quartileName from the quartileMap table in the Axis, and the Test measure as values.
Only thing is that the Quartile axis is not sorting by sortOrder, but alphabetically, causing Outliers to appear before Quartile 1, 2, 3. Instead of after Quartile 1, 2, 3. Not sure what the sortOrder does in this table. Never mind this last part, I had to select the quartileName column and sort it by sortOrder
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
20 | |
18 | |
18 | |
15 |
User | Count |
---|---|
37 | |
19 | |
19 | |
17 | |
11 |