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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ysherriff
Resolver II
Resolver II

Sort custom slicer alphabetically in slicer panel

Hi, 

I created a slicer panel and want to know how I can sort alphabetically. I searched everywhere and can't seem to find this simple solution.

 

Thanks for your help.

 

 

ysherriff_0-1664923254478.png

 

1 ACCEPTED SOLUTION

Thanks but the solution was to trim the text. There was spaces in front of the values.

 

Much appreciated.

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @ysherriff ,

Please refer to my steps to see if it helps you.

vpollymsft_0-1664938335528.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcgsOUIrViVZydA2G0Dk5CsGp6WC2U2a+o4JPYgqM4wvkJIE5zql5JUWJORB+LAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"department selection" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"department selection", type text}}),
    #"Duplicated Column" = Table.DuplicateColumn(#"Changed Type", "department selection", "department selection - Copy"),
    #"Split Column by Position" = Table.SplitColumn(#"Duplicated Column", "department selection - Copy", Splitter.SplitTextByRepeatedLengths(1), {"department selection - Copy.1", "department selection - Copy.2", "department selection - Copy.3", "department selection - Copy.4", "department selection - Copy.5", "department selection - Copy.6", "department selection - Copy.7", "department selection - Copy.8", "department selection - Copy.9", "department selection - Copy.10", "department selection - Copy.11"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Position",{{"department selection - Copy.1", type text}, {"department selection - Copy.2", type text}, {"department selection - Copy.3", type text}, {"department selection - Copy.4", type text}, {"department selection - Copy.5", type text}, {"department selection - Copy.6", type text}, {"department selection - Copy.7", type text}, {"department selection - Copy.8", type text}, {"department selection - Copy.9", type text}, {"department selection - Copy.10", type text}, {"department selection - Copy.11", type text}}),
    #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"department selection - Copy.2", "department selection - Copy.3", "department selection - Copy.4", "department selection - Copy.5", "department selection - Copy.6", "department selection - Copy.7", "department selection - Copy.8", "department selection - Copy.9", "department selection - Copy.10", "department selection - Copy.11"}),
    #"Added Conditional Column" = Table.AddColumn(#"Removed Columns", "Custom", each if [#"department selection - Copy.1"] = "A" then 1 else if [#"department selection - Copy.1"] = "B" then 2 else if [#"department selection - Copy.1"] = "C" then 3 else if [#"department selection - Copy.1"] = "F" then 6 else 0)
in
    #"Added Conditional Column"

 

Then sort the department selection by the custom column.

vpollymsft_1-1664938460815.png

If I have misunderstood your meaning, please  provide more details with the desired output and pbix file without privacy information.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ribisht17
Super User
Super User

@ysherriff 

 

Please check https://community.powerbi.com/t5/Desktop/Slicer-item-custome-sort/m-p/2481370

 

Thanks,

Ritesh

Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series

 

Thanks but the solution was to trim the text. There was spaces in front of the values.

 

Much appreciated.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors