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

October 28 & 29: Experts share their secrets on how to pass the Fabric Analytics Engineer certification exam—live. Learn more

Reply
nogi
Advocate II
Advocate II

Sort legend

How can i do a manual sort on the legend in a graph visual? Because i use numeric description in the text it sorts as alphas rather than numeric:legend.PNG

 

 


I want it sorted in time order:

  1. Early
  2. On time
  3. 5 - 10 days
  4. 11 - 15 days
  5. 16+ days
1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@nogi

 

I assume the "bucket" column you put in Legend should be based on another numeric column. You can't directly have this "Bucket" column sort by that numeric column. 

 

In this scenario, you can create another sort table like:

 

Bucket Order
Early 1
On time 2
5 - 10 days 3
11 - 15 days 4
16+ days 5

 

 

Then build the relationship to your existing table on Bucket column, and use "merge queries" to join the Order column into existing Query. Now you should be able to have the Bucket column sort by Order column. 

 

6.PNG

 

Regards,

View solution in original post

8 REPLIES 8
v-sihou-msft
Microsoft Employee
Microsoft Employee

@nogi

 

I assume the "bucket" column you put in Legend should be based on another numeric column. You can't directly have this "Bucket" column sort by that numeric column. 

 

In this scenario, you can create another sort table like:

 

Bucket Order
Early 1
On time 2
5 - 10 days 3
11 - 15 days 4
16+ days 5

 

 

Then build the relationship to your existing table on Bucket column, and use "merge queries" to join the Order column into existing Query. Now you should be able to have the Bucket column sort by Order column. 

 

6.PNG

 

Regards,

I'm trying to present some survey data:

 

- Questions: It has 5 questions

- Responses: 12 possible responses

- Instances: the number of times individuals selected that response

 

I'm having trouble ordering the responses, in the visual below, it's trying to order by reason alphabetically but I have a different order I want. I've created an order table as you suggested below and Left joined it to the core data table using the 'Reason' field.

 

What are the steps to now order the reasons by the joined order value?

 

Thanks!

 

Current visual with instances ordered by reason alphabeticallyCurrent visual with instances ordered by reason alphabetically

The above visual has the colours in the coloumns ordered by reason alphabetically.

 

Core data table showing questions, responses and instances.Core data table showing questions, responses and instances.Order table created to order the responsesOrder table created to order the responses

Regardless of whether you relate the tables or merge them:

 

1. Select your "Response" field

2. Select the "Sort by Column" button

 

x.PNG

3. Select your "Order" column

Hello, 

 

I tried out what you suggested but the option to sort by 'Order' isn't showing. I've added some screen shots to show how I've created the relationship and that I've merged the tables to add 'Order' to my survey data.

 

Where have I gone wrong?

Shot showing that I've merged the queries, successfully i think?Shot showing that I've merged the queries, successfully i think?Shot showing the relationship I've created between the two tables. Linking responses togetherShot showing the relationship I've created between the two tables. Linking responses togetherShow showing that when I have responses selected the 'Sort by' option is showing 'Order' as an optionShow showing that when I have responses selected the 'Sort by' option is showing 'Order' as an option

@JWorthy,

 

Click the two arrows next to "Legend Order" to expand to merge and choose the "Order" column to attach to the table.

 

y.PNG

Sorted Thanks!

Thanks for your help!

Not sure why you're joining it, just make a relationship between the two tables

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

October NL Carousel

Fabric Community Update - October 2024

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