Forum Discussion
Using Measure in chart axis, or make column instead of measure
- 6 years ago
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
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