1
votes

I am trying to figure out how can I sort column values from highest to lowest in Power BI Matrix Visual. I have a small matrix with 3 columns: "No", "Yes" and "Total" and on rows I have the name of some people.

What I want to do is to sort values from highest to lowest in the "No" column but when I click on sort by I only get the option to filter by total count and the names of the people, I have added a picture below for better context. Any help will be much appreciated!

enter image description here

1

1 Answers

1
votes

This can be done by creating three measures. Don't use the implicit measures, always create your own.

First, create the measure that generates the total you use right now. It may be a count, it may be a sum, I cannot tell because I don't know your data source. Let's call that measure "total".

Assuming your data source has a column with the "yes" and "no" values, and assuming the name of that column is "status", you can then create two additional measures.

TotalYes = CALCULATE([total],'Table'[status]="yes")
TotalNo = CALCULATE([total],'Table'[status]="no")

Add these measures to the matrix and remove the status column from the columns well. You can now sort the matrix by the "TotalNo" column. Of course, you can rename the column in the matrix, so it just says "No".

enter image description here