In this Power Bi tutorial, we will see how to sort by multiple columns in Power BI. In addition, we will also see how to sort columns alphabetically order and in descending order in Microsoft Power BI. Also covered below topics:
- How to sort by multiple columns in Powert Table Visual
- Sort by multiple columns DAX in Power BI
- Power BI sort by multiple columns matrix
- Power BI matrix sort columns Descending
- Power BI matrix sort columns by value
Here, we will use a Power BI table visual and we will sort the table by multiple columns in Power BI.
Power BI sorts by multiple columns in Table Visual
Here we will see how to sort by multiple columns in the Power BI Table visual.
In this example, we use the Team Appearances table data to sort multiple columns for the table visualization in Power Bi.
Follow the below-mentioned steps:
- Initially, log in to the Power Bi desktop and load the data into it using the get data option.
- From the visualization, select the table visual, then drag and drop the values of the field from the field pane as below:

Here we will sort by multiple columns for the below-mentioned column names:
- Teams
- Winning Time Count
- Press Shift + Left Click on the Column Header for which we want to apply Multiple Sort.
- Here, we will select the Teams Column with Shift + Left Click. In the screenshot below, You can see, first, it sorts the data based on the Teams and then it sorted data for the Winning Time Count column.

- Now in the same way, if we want to sort the Team Id column, Press Shift + Left Click on the Column Header.
- It sorts the Team Id column with multiple columns presented in the table visual in Power Bi.

This is how to sort by multiple columns in a Power BI report.
Power BI sorts by multiple columns in the matrix
Let us see how to sort by multiple columns in the matrix visual in Power Bi,
No, in the Matrix visual, it is not possible to sort multiple columns in the Power Bi report.
To sort the single column in the Matrix visual, follow the below steps:
- Load the data into the Power bi desktop using the get data option. From the visualization, select the matrix visual, then drag and drop the values of the field from the field pane as below:

- Here we will sort Team Id columns for that Press Shift + Left Click on the Column Header to apply the sort on the matrix visual.
- In the screenshot below, You can see, first, it sorts the Team Id column presented in the Power Bi report matrix visual.

This is how to sort by multiple columns in matrix visual in a Power Bi report.
Check out the Power BI sort table by Date
Power BI sorts columns alphabetically
Let us see how to sort by columns alphabetically in Power Bi,
- In the previous heading, as we discussed load the data into the Power Bi desktop.
- Then click on transform data from the ribbon on the power bi desktop, it will redirect to the power query editor.

- In the Power Query editor, choose the column for which you want to sort alphabetically and right-click on the column and choose the sort ascending option and click on the ok button, it will sort and display the column alphabetically.
- In this example, we will sort the team’s columns alphabetically as highlighted below:

- In the below screenshot, you can see that the value has been expanded and displayed as below: Now click on the close and apply the option to save the changes.

This is how to sort by columns alphabetically in Power Bi.
Power BI sort by column descending
Let us see how to sort by columns in descending order in Power Bi,
- Load data using the get data option into the Power Bi desktop. Then click on transform data from the ribbon on the power bi desktop, it will redirect to the power query editor.

- In the Power Query editor, choose the column for which you want to sort descending and right-click on the column and choose the sort descending option and click on the ok button, it will sort and display the column in descending order.
- In this example, we will sort the team’s columns in descending order as highlighted below:

In the below screenshot, you can see that the value has been expanded and displayed as below: Now click on the close and apply the option to save the changes.

This is how to sort by columns in descending order in Power Bi.
Power bi sort by multiple columns dax
Now we will see how to sort by multiple columns using the Power Bi Dax in Power Bi.
- Load the data table into the Power Bi desktop using the get data option, click on the new measure option presented under the modeling tab, and apply the below-mentioned formula.
Sort columns = RANKX(ALL('Team A'),CALCULATE(MAX('Team A'[Winning Time Count])),,ASC,Dense)
Where,
- Sort columns = New measure name
- RANKX = Function Name
- Team A = Table Name
- Winning Time Count = Column Name
- Select the table visual from the visualization pane. In the value field drag and drop the Teams, Team ID, and Winning Time count fields and also the created measure value as shown below:

- Select the ellipsis icon (…) at the top right of the table visual. Then choose sort by -> Sort Columns.
- It will sort the multiple columns presented in the table visual based on the created measure value., in ascending order as highlighted below:

This is how to sort multiple columns using the Power Bi Dax in Power Bi.
Power BI matrix sort columns by value
Now, let us see an example of how to sort columns by value in Power BI matrix visual.
In this example, we use the financials excel sheet to sort multiple columns for the matrix visualization in Power Bi.
- Load the data into the Power Bi desktop using the get data option, and select the matrix visual from the visualization.
- Drag and drop the field values from the field pane as shown below:

- Now to sort the columns based on the sales value field, click on the ellipsis icon (…) and select the sort by option and choose the sales value as highlighted below:

In the below screenshot, you can see that sales values presented in the matrix visual have been sorted by multiple columns in Power Bi.

This is how to sort columns by value in the Power BI matrix visual.
This Power Bi article clearly showed how to sort by multiple columns in Power BI. In addition, we will also see how to sort by columns alphabetically order and in descending order in Power BI. Also covered below points:
- Power BI sort by multiple columns in Table Visual
- Power BI sort by multiple columns DAX
- Power BI sort by multiple columns matrix
- Power BI matrix sort columns Descending
- Power BI matrix sort columns by value
You may like the following Power BI tutorials:
- Dataverse Power BI
- How to create a relationship in power bi without unique values
- Power BI cross filter direction
- How to Merge Tables in Power BI
- How to remove Date Hierarchy in Power BI
I am Bijay a Microsoft MVP (8 times –Â My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com