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.
I need to sort a stacked bar chart by age group. I've used the methods of creating a separate table to sort, and index column to sort column order by, and rankx to create another column to sort by. These have all worked in the past but not now. The only difference I can guess is that this time I am using power bi database as my data source. Does anyone know a way around this problem?
Hi @Anonymous
Does @harshnathani 's solution solve your problem? It should work. I connected to this dataset after publishing it to service, and created some visuals to check the sort. It worked well at my side. Let us know your result. Thanks.
Regards,
Community Support Team _ Jing Zhang
Here's the pbix. Hopefully, it helps!
https://drive.google.com/file/d/1Y8G4XznDIxZEwfe1QrPL5JNWAaSKj8Dq/view?usp=sharing
Hi @Anonymous ,
Have sorted the age category column by index and then created the visual again.
Let me know if this is what is needed.
pbix attached.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @Anonymous , can you share some dummy data or PBIX file (remove sensitive info) which can help reproduce this issue? Thanks.
Regards,
Community Support Team _ Jing Zhang
@Anonymous ok, not sure where the problem is, I would recommend sharing sample pbix file (remove sensitive info before sharing) and also the expected output, it will help to provide the solution.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous well you have to apply this sorting method in Power BI dataset you are connecting to. So basically get this change made in the Power BI data model.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Yes. I thought I had explained that I had already done that but it is still not working. I have applied all of the previously mentioned methods to the database, but it is not working.
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 |
---|---|
85 | |
42 | |
30 | |
27 | |
26 |