Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I am trying to represent sections averages in different schools from the highest section average to the lowest within each school.
Below is an example, each school is represented by a color and each section is represented by a bar.
I tried that with a column chart and I can only sort by section (alphabetically) or by average (numerically).
I tried this ranking:
Rank = RANKX(VALUES([School Name]), RANK.EQ(1, [Final_average], ASC), ,ASC, Skip)
but it didn't make any sense.
Any help on how can this be achieved in PBI?
Thanks.
Hi @SabineOussi,
You can use below formula to calculate the each rank of school, then use a clstered column chart to show the result.
Source table:
Calculate column:
Ranking = RANKX(FILTER(Sheet2,Sheet2[School]=EARLIER(Sheet2[School])),[Average],[Average],DESC,Dense)
Visual:
Regards,
Xiaoxin Sheng
Thank you @Anonymous
Unfortunately I am connected to a complex database and there are a lot of selections through slicers in order to come with this particular graph.
So your solution is giving me the overall rank of the sections and not on that particular selection, so it's not really by school.
What I did is convert the schools to a high value number and add that number to the raking column and have my chart sorted by that.
School_Ranking: School1 = 100000, School2 = 200000
Final_Ranking: School_Ranking + Ranking
And finally sections are ranked correctly according to their schools.
One thing remains is to re-rank these sections from 1 to n instead of that big number under each bar.
Any thoughts?
Hi @SabineOussi,
Perhaps you can try to calculate the new rank based on the filtered columns.
Regards,
Xiaoxin Sheng
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
75 | |
68 | |
39 | |
35 |
User | Count |
---|---|
107 | |
56 | |
52 | |
48 | |
40 |