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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Andrewutter12
Frequent Visitor

Resorting age group buckets

Hello all,

I have a pie chart showing invoice amounts by by age group Current, 31-60, 61-90, 91-20 and over 120. Unfortunately, on my visualization, those buckets are out of order. Is there a way I can fix this to show in order?

 

Andrewutter12_0-1605203524469.png

Thank you!

1 ACCEPTED SOLUTION
vpatel55
Kudo Commander
Kudo Commander

The easiest way would be to add a "1", "2", etc, to the labels.

But a neater way would would be to add a sort column. Here, you would add a new column next to each of the labels, such as Current being 1, and 31-60 being 2, etc. You can do that using SWITCH.

 

So the calculated column would be:

 

Sort column = SWITCH 'table name' [Age group], "Current","1",31-60","2", etc.

 

Then click on "Age group" field, and then click on sort by column, and then click on your new sort column. That should do it.

 

vpatel55_0-1605204041660.png

 

View solution in original post

2 REPLIES 2
Andrewutter12
Frequent Visitor

This seemed to do the trick. Thank you!

vpatel55
Kudo Commander
Kudo Commander

The easiest way would be to add a "1", "2", etc, to the labels.

But a neater way would would be to add a sort column. Here, you would add a new column next to each of the labels, such as Current being 1, and 31-60 being 2, etc. You can do that using SWITCH.

 

So the calculated column would be:

 

Sort column = SWITCH 'table name' [Age group], "Current","1",31-60","2", etc.

 

Then click on "Age group" field, and then click on sort by column, and then click on your new sort column. That should do it.

 

vpatel55_0-1605204041660.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.