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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mj2024
Helper II
Helper II

Change sort order in a slicer

Hi

I have a slicer that selects which data series to plot.  The order of the data series in the slicer is not in an order I like:

Screenshot 2024-12-25 201010.png

 

It should read Relative 20 then Relative 50 then Relative 100.  Here is the measure:

 

 

Relative Data Selector = 
DATATABLE(
"DataSource", STRING,
{
{"Relative 20"},
{"Relative 50"},
{"Relative 100"}
}
)

 

 

 

The order in the measure is correct but the slicer is sorting it in a way I don't like.  Is there a way for the slicer to follow the order I am looking for?

Thank you

 

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

One of ways is to create a sort column, something like below, and then select the DataSource column, and sort it by the sort-column.

Please check the below picture and the attached pbix file.

 

DATATABLE function - DAX | Microsoft Learn

 

Relative Data Selector =
DATATABLE (
    "DataSource", STRING,
    "Sort", INTEGER,
    {
        { "Relative 20", 1 },
        { "Relative 50", 2 },
        { "Relative 100", 3 }
    }
)

 

Jihwan_Kim_0-1735186954081.png

 

Jihwan_Kim_1-1735187129942.png

 

Jihwan_Kim_2-1735187164968.png

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

One of ways is to create a sort column, something like below, and then select the DataSource column, and sort it by the sort-column.

Please check the below picture and the attached pbix file.

 

DATATABLE function - DAX | Microsoft Learn

 

Relative Data Selector =
DATATABLE (
    "DataSource", STRING,
    "Sort", INTEGER,
    {
        { "Relative 20", 1 },
        { "Relative 50", 2 },
        { "Relative 100", 3 }
    }
)

 

Jihwan_Kim_0-1735186954081.png

 

Jihwan_Kim_1-1735187129942.png

 

Jihwan_Kim_2-1735187164968.png

 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Thank you @Jihwan_Kim .  It works!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.