cancel
Showing results for 
Search instead for 
Did you mean: 
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!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

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!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

View solution in original post

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
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors