Power BI: sort values according to my needs
To sort, I have the 2 default options called “sort ascending” and “sort descending” but they may not sort like how I want so I will need to customize it. For example, I have this table:

I create a slicer and by default, it sorts them ascending but the result is not what I want because what I want, it is to sort it like in my table:

Even if I do it by descending, I don’t get what I want:

Let’s start by the easy one, to sort the name column, I will create an index column:

NOTE: to know how, read Power BI: sort correctly with index/ranking
Then configure the name column to use this index column to sort them with the “sort by column” option:

For the “group” column, I will extract it by creating a new table and duplicating it with another name called “sortgroup”:

NOTE: to know how, read Power BI: extract columns from a table to another one
Then I will create a new column with this simple formula to create an index using the duplicate (sortgroup) column:

NOTE: alternatively, I can use the SWITCH function

And like the name column, I will select the group column and using the “sort by column” option:

To finalize, I will create a relationship by making sure that "both" is selected in "cross-filter direction":


Now, if I recreate my filter using the group from my new table, I get the same sorting as in my table:

For a better management, particularly for a big data, I will recommend to use excel to manage the index.
Interesting Topics
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...
-
Refresh Power BI
From the Power BI Service, I can set refresh but, for instance, there is no option to do it monthly or each time a change is made...
-
Power BI alerts to be sent by email from an excel file based on condition
I will explain how to send a list of emails from an excel file after creating alerts...