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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Community Champion
Community Champion

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.



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

7 REPLIES 7
Chris12
Advocate I
Advocate I
Greg_Deckler
Community Champion
Community Champion

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.



Follow on LinkedIn
@ 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!:
DAX For Humans

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
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.