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

Change the order of a group

Is there a way to set the order for a group? I'd like to change the order to:
Gross Margin

Expenses

Amortization

Interest

Taxes

Grouping.png

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Generally, you need to go into your query and create a "sort" column which essentially is a column that looks at your other column and returns the integer sorting that you want. So, basically a conditional column that is "if [column] = Gross Margin then 1, else if [column]=Expenses then 2..."

 

Then you can set your "Sort By" column in Desktop for the original column to be this "sort" column.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

7 REPLIES 7
Chris12
Advocate I
Advocate I
Greg_Deckler
Super User
Super User

Generally, you need to go into your query and create a "sort" column which essentially is a column that looks at your other column and returns the integer sorting that you want. So, basically a conditional column that is "if [column] = Gross Margin then 1, else if [column]=Expenses then 2..."

 

Then you can set your "Sort By" column in Desktop for the original column to be this "sort" column.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
NipponSahore
Resolver II
Resolver II

The order is usually alphabetically. 

You can add a prefix to the name to order it in the order you like 

 

1. Gross Margin

2. Expenses

3. Amortization

4. Interest

5. Taxes

After messing around with DAX and trying to create a sort index, but running into circular dependency errors, I decided to use this method instead. Simple and effective; only adds 3 extra characters, which I can live with. Thanks for the tip!

But if you have more than then items the first is set wuth the eleven 😞

For tens of items, prefix each item with a two-digit number: 01, 02, 03, . . . , 10, 11, 12, . . .

But if you have more than then items the first is set wuth the eleven 😞

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.

Top Solution Authors