Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Can't sort column using index or rankx power bi database

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?

7 REPLIES 7
v-jingzhang
Community Support
Community Support

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

Anonymous
Not applicable

Hi @Anonymous ,

 

Have sorted the age category column by index and then created the visual again.

 

1.PNG

 

2.PNG

 

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)

 

v-jingzhang
Community Support
Community Support

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

parry2k
Super User
Super User

@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.

parry2k
Super User
Super User

@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.

Anonymous
Not applicable

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.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors