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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
Super User
Super User

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.