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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
alanuxx
Frequent Visitor

Power BI Sort Hidden Row in Matrix

Hi Everyone ,

 

I need to sort index row which is hidden on matrix . First of all i have basic table as below. There is an index col combined by some columns .

 

alanuxx_1-1692300029925.png

 

 

I need to use Matrix instead of table as below .I removed index column from matrix, then  it has been sorted by Main product code alphabetically . But i want to sort by index col . Product2 should be first ,then PRODUCT2,PRODUCT0004 ,PRODUCT4

 

How can i sort by hidden row on a matrix ? 

 

alanuxx_2-1692300101100.png

 

Regards

 

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

Hi @alanuxx ,

 

Can you add index columns in Power Query Editor? If could, it would be really easy.

1.Sory by INDEX_COL in it.

vstephenmsft_0-1692693529938.png

 

2.Group by MAIN_PRODUCT_CODE and add an index column.

vstephenmsft_1-1692693753339.png

vstephenmsft_2-1692693779891.png

 

 

3.Expand the tables, then group by SUB_PRODUCT_CODE and add an index column.

vstephenmsft_3-1692693794552.png

vstephenmsft_5-1692693824174.png

4.Now we get two sort columns. Go back to Power BI Desktop, sort SUB_PRODUCT_CODE and MAIN_PRODUCT_CODE by two index columns.

vstephenmsft_6-1692693830670.png

vstephenmsft_7-1692693945221.png

vstephenmsft_8-1692693963045.png

Expected result:

vstephenmsft_9-1692693981615.png

                                                                                                                                                    

Best Regards,

Stephen Tao

 

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

5 REPLIES 5
v-stephen-msft
Community Support
Community Support

Hi @alanuxx ,

 

Can you add index columns in Power Query Editor? If could, it would be really easy.

1.Sory by INDEX_COL in it.

vstephenmsft_0-1692693529938.png

 

2.Group by MAIN_PRODUCT_CODE and add an index column.

vstephenmsft_1-1692693753339.png

vstephenmsft_2-1692693779891.png

 

 

3.Expand the tables, then group by SUB_PRODUCT_CODE and add an index column.

vstephenmsft_3-1692693794552.png

vstephenmsft_5-1692693824174.png

4.Now we get two sort columns. Go back to Power BI Desktop, sort SUB_PRODUCT_CODE and MAIN_PRODUCT_CODE by two index columns.

vstephenmsft_6-1692693830670.png

vstephenmsft_7-1692693945221.png

vstephenmsft_8-1692693963045.png

Expected result:

vstephenmsft_9-1692693981615.png

                                                                                                                                                    

Best Regards,

Stephen Tao

 

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

 

Idrissshatila
Super User
Super User

Hello @alanuxx ,

 

So, you click the three dots of the matrix then click sort by then click the column you want to sort by with.

 

Idrissshatila_0-1692301004621.png

 

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote For my Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




My index col is not on the matrix.How can i choose this column?

Hello @alanuxx ,

 

then in the data view, go to the product column you're referencing in the matrix then click on it then click sort by column and click on index. this way the product your're viewing in matrix will be sorted by matrix.

Idrissshatila_0-1692308177454.png

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Follow me on Linkedin
Vote For my Idea 💡



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




i am getting from Tabular model .i sorted index column on tabular as well . But nothing changed.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 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.