Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
I have a stacked bar chart where I am trying to rank Organization by count of Programs and Count of Applications, so I have 2 columns/colors/counts showing up in each bar. I am able to sort by using the Top N advanced filtering option for the Count of Programs, but some Programs can have multiple applications within them, so 3 organizations could each have 5 Programs, but then Organization 1 could have 5 applications, Organization 2 could have 8, and so on. I would like to be able to also order the organizations by application as a secondary sort. What is the best way to go about this? Most info on sorting that I've found involves doing something in the dataset, but in this situation my columns aren't summarized by count until I add them to the visual.
Try this
Rank by program and application=
VAR Myprogram = SELECTEDVALUE(yourtable[program])
VAR Myapplication= SELECTEDVALUE(yourtable[District])
RETURN
RANKX(
FILTER(ALLSELECTED(yourtable), yourtable[program] = Myprogram && yourtable[District] = MyDistrict),
CALCULATE(SUM(yourtable[youramount])),
,DESC,
Dense
)
Please click thumbs up abd also the accept as solution button. Thank you `