Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hi!
How do I sort a stacked bar chart by age group in ascending order?
From Below 18 Years old to 65+ Years old?
Thanks!
Solved! Go to Solution.
I take it you've created those "Bins" with a conditional column
I'm calling this column Category in the image below
Then I use it to create another Column called Custom Sort which we'll use to sort the Bars
See image below - let me know if you have any questions...
Hope this helps! ![]()
EDIT: I've used the Query Editor for both columns
but you can use SWITCH statements (nested IFs) to get the same results with DAX created columns! ![]()
Click the ellipses ... in the top right corner of the Visual - Sort By
I already tried it but the result looks like this:
In my mind it shoutd be:
Below 18 Years Old
18-24 Years Old
25-34 Years Old
35-44 Years Old
45-54 Years Old
55-64 Years Old
65+ Years Old
is there a way to manually sort it?
Thanks!
I take it you've created those "Bins" with a conditional column
I'm calling this column Category in the image below
Then I use it to create another Column called Custom Sort which we'll use to sort the Bars
See image below - let me know if you have any questions...
Hope this helps! ![]()
EDIT: I've used the Query Editor for both columns
but you can use SWITCH statements (nested IFs) to get the same results with DAX created columns! ![]()
Thanks! I got it! 🙂
What books do you recommend in using the powerbi more effectively and efficiently?
Thanks!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 80 | |
| 40 | |
| 31 | |
| 27 | |
| 27 |