cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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

 

AgeRanges.PNG

 

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

5 REPLIES 5
Thejeswar Senior Member
Senior Member

Re: Ordering a ledgend based on age range

@johnbradbury,

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

Re: Ordering a ledgend based on age range

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

 

 

Kristan Frequent Visitor
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.

 

Please let me know if you need more information.

 

 

 

 

 

 

Microsoft v-jiascu-msft
Microsoft

Re: Ordering a ledgend based on age range

Hi @johnbradbury,

 

@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.
Microsoft v-jiascu-msft
Microsoft

Re: Ordering a ledgend based on age range

Hi @johnbradbury,

 

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.

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors