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
Anonymous
Not applicable

Matrix Sorting Problem

Hi,

 

I want to sort the number under value chain (bold format) in the very first column. Sorting it by number does not change the order. 

jdalfonso_0-1669217666759.png

I want to be able to sort it by number in ascending sequence 

 

jdalfonso_1-1669217783857.png

 

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

In the Power Query editor, sort the numbers in ascending order, and then add an index column.

vtangjiemsft_0-1669254719028.pngvtangjiemsft_1-1669254744090.pngvtangjiemsft_2-1669254809264.png

Click "Close and Apply" and sort the index columns in Desktop.

vtangjiemsft_4-1669254951025.png

Then the result is as follows.

vtangjiemsft_5-1669255140580.png

You can refer to the following documents that may be helpful to you:

Custom sort / reorder rows & columns in Power BI - Inforiver

Hierarchical Sorting in Power BI - Stuff by Yuki

Quick Tips: How to Sort Matrix by Column in Descending Order - BI Insight

Sorting matrices in Power BI - Kohera

 

If you want to sort by both [VALUE CHAIN] and [Number]. You can create a table 2, enter the data of the [VALUE CHAIN] field in the desired order, and then create an index column in the power query, sort by the index column, and put the [VALUE CHAIN] field of table 2 in the matrix, note that the model relationship is created between table 1 AND TABLE 2.

vtangjiemsft_6-1669255900655.png

 

Best Regards,

Neeko Tang

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

1 REPLY 1
v-tangjie-msft
Community Support
Community Support

Hi @Anonymous ,

 

In the Power Query editor, sort the numbers in ascending order, and then add an index column.

vtangjiemsft_0-1669254719028.pngvtangjiemsft_1-1669254744090.pngvtangjiemsft_2-1669254809264.png

Click "Close and Apply" and sort the index columns in Desktop.

vtangjiemsft_4-1669254951025.png

Then the result is as follows.

vtangjiemsft_5-1669255140580.png

You can refer to the following documents that may be helpful to you:

Custom sort / reorder rows & columns in Power BI - Inforiver

Hierarchical Sorting in Power BI - Stuff by Yuki

Quick Tips: How to Sort Matrix by Column in Descending Order - BI Insight

Sorting matrices in Power BI - Kohera

 

If you want to sort by both [VALUE CHAIN] and [Number]. You can create a table 2, enter the data of the [VALUE CHAIN] field in the desired order, and then create an index column in the power query, sort by the index column, and put the [VALUE CHAIN] field of table 2 in the matrix, note that the model relationship is created between table 1 AND TABLE 2.

vtangjiemsft_6-1669255900655.png

 

Best Regards,

Neeko Tang

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

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.