cancel
Showing results for
Did you mean:
Helper III

## Ordering a ledgend based on age range

I need to order these :

0-5 = 1

6-20 = 2

21-50 = 3

50> = 4

I have a calculated column called 'Age Profile' which outputs 0-5 etc....

I would be really grateful if someone could help me done this.

5 REPLIES 5
Solution Sage

## Re: Ordering a ledgend based on age range

I am not sure if there is a way to sort the Legends.

But Is it possible for you to make small changes in your age group values such as follows

6-20 to 06-20

50> to Above 50

This you need to do because since this column is of type text, the sorting is done by checking character by character. So it is essential that you make these changes for it to work

This will fix this sort issue

Regards,

Thejeswar

Helper III

## Re: Ordering a ledgend based on age range

I'm sure I've seen this done, I just can't find it.

Frequent Visitor

## Re: Ordering a ledgend based on age range

Not sure if this is the best way to go about it, but I would:

1. Create a conditional column in query editor that generates a new column that states the order you want

2. Highlight the Age Profile column in the Fields tab , click on modeling tab, click on sort by column, then select the order column you created in step 1.

Microsoft

## Re: Ordering a ledgend based on age range

@Kristan showed the solution. Please give it a try.

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Microsoft

## Re: Ordering a ledgend based on age range

Could you please tell me if you get the solution?

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

#### ‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

#### Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

#### Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

#### Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors