# shorts: Power BI Tips: Custom Sorting to Power BI Visuals with Power Query

Опубликовано: 19 Март 2025
на канале: Mike YU (BI&Analytics)
321
1

The power BI report matrix visual describes column values fields by row strings fields. They are listed in ascending order by alphabets. We want to sort them by Systolic BP, Diastolic BP, the Heartbeat. These string inputs come from a column of the table “BP_Max_Min_Unpivot_Table_by_M”..

To get the custom sorting we may create a DIM table by enter new table, name the table and it’s column, give input to each row by expected order. click Edit, in query editor, “Add an index Column” by choosing “From 1”. Close and apply the query. In Data view Click the column “Attribute” of the new table, sort it by column “Index”. In Model view, build the relationship with Table “BP_Max_Min_Unpivot_Table_by_M”. in report view choose the matrix, replace row field input by the column “Attribute” of the new table, we see the expected sorting order.

For more info of my BI & Analytics, please refer to the following website links:

My BI & Analytics Website:
https://sites.google.com/view/mikegua...

My blog website :
https://mikeyubianalytics.blogspot.com/