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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
krueb
Frequent Visitor

Ability to create a visualization to Sort by one column then another

I have a details data set

StatePriority
Release Ready2
In Progress1
Release Ready1
In Progress4
Sprint Ready3
Release Ready1
Sprint Ready1

 

I have a separate table with a relationship to the details table by State

StateState Sort Order
Release Ready1
In Progress2
Sprint Ready3

 

In a visualization I want to be able to show the States in State Sort Order Ascending (without displaying the State Sort Order column) to the end user, then, by the Priority Order Ascending

StatePriority
Release Ready1
Release Ready1
Release Ready2
In Progress1
In Progress4
Sprint Ready1
Sprint Ready3
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi @krueb 

For your case, you could try this way:

Step1:

You need to create a relationship between data table and separate sort table by state column

Step2:

In data view for separate sort table, Selected state column then choose sort by column->State Sort Order

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column

 

2.JPG

Step3:

When create visual, just use state field from this separate sort table instead of data table.

 

Result:

3.JPG

 

and here is sampel pbix file, please try it.

 

 

Regards,

Lin

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

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi @krueb 

For your case, you could try this way:

Step1:

You need to create a relationship between data table and separate sort table by state column

Step2:

In data view for separate sort table, Selected state column then choose sort by column->State Sort Order

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column

 

2.JPG

Step3:

When create visual, just use state field from this separate sort table instead of data table.

 

Result:

3.JPG

 

and here is sampel pbix file, please try it.

 

 

Regards,

Lin

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

It didn't work the way I thought it would, I can sort by the state order, but when I try and sort by the priority so I can see all the number 1 priorites in state order, it just sort by the prioirty regardless of the state . . .

amitchandak
Super User
Super User

@krueb , you can choose one sort column and mark it as sort column

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

Sort Month.pngSort_by_column.png

mahoneypat
Employee
Employee

In Data View for your table with 3 rows, highlight the State column and then on Column Tools above choose Sort By Column, and choose your State Sort Order column.  Also see this link for more details.  You should also then be able to sort by Priority in your visuals.

 

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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