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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Bar Chart Sort w/Groups

Hello everyone - 

 

Tried searching and attempted a few resolutions but was unable to solve this. Would appreciate your help. 

 

I have a data set as follows: 

 

Column title: Tenure 

Data Inside: Employee tenure in years, by decimal, for an accurate visual 

 

I'm trying to create a visual which will showcase #of EEs by Tenure in buckets. I tried two things to resolve this sorting issue 

 

1. Creating a conditional column and categorizing tenure by buckets, then visualize 😕 sorting was still off 

2. Created groups based on the column and list the variables then categorize, still same issue when sorting 

 

Here's the resulted visual . . any advice would be helpful! As you can see the tenure years are not in order. 5.1-10 should not be last. 

BarChart.PNG

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Anonymous 

What you need is a numeric column in your data that tells PowerBI how to sort your Tenure column.  In my example I added a column to the table based on the Tenure Months.

TenureSort = 
SWITCH (
    TRUE (),
    Employees[Tenure Months] < 13, 1,
    Employees[Tenure Months] < 61, 2,
    Employees[Tenure Months] < 121, 3,
    Employees[Tenure Months] < 181, 4,
    5
)

Use the same logic for this column that you used for the Tenure column, just return the number instead.

Then, in the table, select the Tenure column and set the "Sort by Column" to be TenureSort.  

SortByTenure.jpg

 

That sorting gets applied to the Tenure column in the visual.

TenureSorted.jpg

 

 

 

View solution in original post

4 REPLIES 4
jdbuchanan71
Super User
Super User

Hello @Anonymous 

What you need is a numeric column in your data that tells PowerBI how to sort your Tenure column.  In my example I added a column to the table based on the Tenure Months.

TenureSort = 
SWITCH (
    TRUE (),
    Employees[Tenure Months] < 13, 1,
    Employees[Tenure Months] < 61, 2,
    Employees[Tenure Months] < 121, 3,
    Employees[Tenure Months] < 181, 4,
    5
)

Use the same logic for this column that you used for the Tenure column, just return the number instead.

Then, in the table, select the Tenure column and set the "Sort by Column" to be TenureSort.  

SortByTenure.jpg

 

That sorting gets applied to the Tenure column in the visual.

TenureSorted.jpg

 

 

 

Anonymous
Not applicable

Genius! thank you, that worked. 🙂

Anonymous
Not applicable

Hi,

 

When you MouseOver the Visual. You would see Three Dots on the Right Side Top Corner of the Visual. Clicking on it would provide a list of Selection in which you would need to Select Sort Ascending and in the Last Item called Values Expand it and Select the X-Axis Category.

 

Accept as a Solution if this has solved your issue 🙂

Anonymous
Not applicable

Hi I tried that before 😉 with both of my approaches as described above. Unfortunately, it's still the same. 😞 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.