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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
therenjithr
Frequent Visitor

Custom Sort Attribute row in unpivot matrix

I created a matrix and below is the format

 

Attributes8/1/20218/2/20218/3/20218/4/20218/5/2021
A2342342323689
B45345234234689
C3345234234689

 

but I want to custom sort the rows like below. Please help

 

Attributes8/1/20218/2/20218/3/20218/4/20218/5/2021
C3345234234689
A2342342323689
B45345234234689
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @therenjithr ,

Here are the steps you can follow:

You can sort according to the customization of Power query.

1. Enter Power query through Transform data, select Add Column – Column From Examples From All Columns.

vyangliumsft_0-1628039374532.png

2. Enter Index123 corresponding to ABC in the column next to it.

vyangliumsft_1-1628039374536.png

3. Select column [Attribute], Column tools – Sort by column – column [Custom].

vyangliumsft_2-1628039374540.png

4. Select Sort ascending in the column [Custom].

vyangliumsft_3-1628039374541.png

5. Result:

vyangliumsft_4-1628039374541.png

 

Best Regards,

Liu Yang

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
therenjithr
Frequent Visitor

I do not had to do step 2, but I used merge query to add mapped column from related table in actual table then followed ur steps on sorting, did the trick. Thanks for your effort.

Anonymous
Not applicable

Hi  @therenjithr ,

Here are the steps you can follow:

You can sort according to the customization of Power query.

1. Enter Power query through Transform data, select Add Column – Column From Examples From All Columns.

vyangliumsft_0-1628039374532.png

2. Enter Index123 corresponding to ABC in the column next to it.

vyangliumsft_1-1628039374536.png

3. Select column [Attribute], Column tools – Sort by column – column [Custom].

vyangliumsft_2-1628039374540.png

4. Select Sort ascending in the column [Custom].

vyangliumsft_3-1628039374541.png

5. Result:

vyangliumsft_4-1628039374541.png

 

Best Regards,

Liu Yang

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

mahoneypat
Microsoft Employee
Microsoft Employee

You'll need to add a Sort By column to do that.

Sort one column by another column in Power BI Desktop - Power BI | Microsoft Docs

 

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


This is  the actual format of data. I created another table with index column and column name and then did the mapping in model. But in the visualization sorting doesnt work unless I add "Sort Column" as either in rows or columns. 

 

DatesColumnNameValuesSortColumn
8/1/2021A2340
8/1/2021B1351
8/2/2021A41230
8/3/2021B351
8/4/2021B2331
8/5/2021C4562
8/5/2021C2432

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors