The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Solved! Go to Solution.
Thanks but the solution was to trim the text. There was spaces in front of the values.
Much appreciated.
Hi @ysherriff ,
Please refer to my steps to see if it helps you.
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.
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.
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.