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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
jaspreet27singh
Frequent Visitor

How can I add custom sort on Hierarchy Slicer in powerbi

Dimensions = {
    ("Date", NAMEOF('table'[DATE]), 0,"Date"),
    ("Week", NAMEOF('table'[WEEK_START]), 1,"Date "),
    ("Month", NAMEOF('table'[DATE_B].[Month]), 2,"Date"),
    ("Advertiser ID", NAMEOF('DIM'[ADVERTISER_ID]), 3,"Platform"),
    ("Advertiser", NAMEOF('DIM'[ADVERTISER_NAME]), 4,"Platform"),
     }
This is the sample of parameter I am using to create slicer where  "Value 4" and "Value 1" are used in values field to create a slicer and it is showing Date options first and then Platform and so on.
 
I want to show "Platform" first and then "Date" right now it is showing alphabetically
 
 
 
 
1 ACCEPTED SOLUTION

Hi @jaspreet27singh ,

Based on my understanding of your requirement, what you is a order-by column for column 'Dimensions'[Value4] as described here: Sort one column by another column in Power BI - Power BI | Microsoft Learn

To create the sort-by column, you can create a calcualted column in table 'Dimensions':

 

SortValue4 = IF([Value4]="Date Dimensions",2,1)

Kind regards,

Martin

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi, @jaspreet27singh 

First, thanks for @Martin_D  reply. The display order in the slicer is really affected by the parameter after NAMEOF, which you can modify to display the desired order.

vyaningymsft_0-1713764632387.png


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Martin_D
Solution Sage
Solution Sage

Hi @jaspreet27singh ,

 

The bold numbers (see below) in your field parameter table define the display order. If you want to change the order, you can change the numbers. But be careful, each number should be unique in this column.

Dimensions = {
    ("Date"NAMEOF('table'[DATE]), 0,"Date"),
    ("Week"NAMEOF('table'[WEEK_START]), 1,"Date "),
    ("Month"NAMEOF('table'[DATE_B].[Month]), 2,"Date"),
    ("Advertiser ID"NAMEOF('DIM'[ADVERTISER_ID]), 3,"Platform"),
    ("Advertiser"NAMEOF('DIM'[ADVERTISER_NAME]), 4,"Platform"),
     }
 
Kind regrads,
Martin

Hi @Martin_D,

It is not working as you mentioned above 

Dimensions = {
    ("Date"NAMEOF('table'[DATE]), 0,"Date"),
    ("Week"NAMEOF('table'[WEEK_START]), 1,"Date "),
    ("Month"NAMEOF('table'[DATE_B].[Month]), 2,"Date"),
    ("Advertiser ID"NAMEOF('DIM'[ADVERTISER_ID]), 3,"Platform"),
    ("Advertiser"NAMEOF('DIM'[ADVERTISER_NAME]), 4,"Platform"),
("Brand", NAMEOF('DIM'[BRAND]), 5,"Brand"),
    ("Product Name", NAMEOF('DIM'[PRODUCT_NAME]), 6,"Brand")
     }

using this and it is showing Brand on top then Date and Platform.
powerbi.png
   

Hi @jaspreet27singh ,

 

Would you like to provide the following information to help understanding what you want?

 

  • The pbix file, including the field parameter and the slicer
  • A full screenshot, including the slicer with all levels expanded, the slicer's field configuration in the "Build" pane of Power BI Desktop and the "Data" pane of Power BI Desktop, and annotations what is wrong for you
  • A drawing of what you want to see?

Thank you!

 

Kind regards,

Martin

Hi @Martin_D ,

I am sharing all possible screenshot below.

 

By default "Date Dimension" is coming fisrt if you see slicer screenshot and requirement is to sort as per user requirement for example Platform first then Date

 

horizontally and vertically does'nt not work here because we have more in list 

 

 

slicer parameterslicer parameterThis one is fields I am using to create slicerThis one is fields I am using to create slicerslicerslicerData partData part

Hi @jaspreet27singh ,

Based on my understanding of your requirement, what you is a order-by column for column 'Dimensions'[Value4] as described here: Sort one column by another column in Power BI - Power BI | Microsoft Learn

To create the sort-by column, you can create a calcualted column in table 'Dimensions':

 

SortValue4 = IF([Value4]="Date Dimensions",2,1)

Kind regards,

Martin

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.