March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a text column in my query. I grouped it in the data fields and was able to create a matrix. However I need to change the default sort order on this grouped column. Tried reading through the tutorials and searched through the existing posts in the forum, however could not figure out how to achieve it. Appreciate your help.
Sample:
Column A from Query - Seattle, Bellevue, Boston, Quincy, Fremont, Los Angeles, ...
Grouped Column B - WA, MA, CA
Default sort order on Matrix - alphabetical
Desired sort order - MA, CA, WA
Solved! Go to Solution.
Since your City field is group on State field, which means it has multiple entries for same State in the table, it's not possible to custom a sort order column to have the State column sorted by this numeric column.
Regards,
If you want the obvious fix vote for https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/16895230-ability-to-specify-custo...
Once you have grouped these items, a new "Field Name (grouped)" field appears in the data table view in PowerBI as a new column in the same table as the original field. Just like any other field, you can set a sort order for this field.
In your case, like the previous commenter said, you CANNOT use the same sort order field as for the initial field (since values likely aren't distinct). However, that doesn't need to stop you from creating a new sorting field!
For example, create a table that looks like:
State SortOrder
MA 1
CA 2
WA 3
Then, link this table to your existing table. Then, in the existing table, create a new field called "Sort Order for States" that is just =related(SortOrderTable[SortOrder]).
Then, that field becomes the one you can use to sort your groups using the "Sort by column" button in the modeling tab.
This worked for me.
Thanks!
Since your City field is group on State field, which means it has multiple entries for same State in the table, it's not possible to custom a sort order column to have the State column sorted by this numeric column.
Regards,
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
146 | |
97 | |
79 | |
69 |