Forum Discussion
Sort in a slicer
hello all,
Here is my problem.
I work on "Power BI Desktop" 2.73.5586.1101 64-bit (septembre 2019).
I have a slicer which use a formatted string, composed with an id and a label, as :
"4512 - BANANE"
"4513 - ABRICOT"
"4514 - KIWI"
I want all the string visible in the slicer (the id and the label), but with an order only on the second part alphabetically:
4513 - ABRICOT
4512 - BANANE
4514 - KIWI
I have another object composed only with the label, but when I set the slicer, I can only choose one object and only sort it ascending-alphabetically or descending-alphabetically.
How could I do ?
Thank a lot
Ok, thanks everyone for your help.
I undestand better my issue.
I want to use just a attribute (a single column) from a table "Products" for a slicer, but I didn't create first a table for this attribute.
I think I should first create the table for the attribute with id and label as columns, and after it will be possible to use differents columns of the new table for the slicer.
B.
8 Replies
- ChrisMendozaResident Rockstar
- BertrandDNew Member
Hi Chris,
Thanks for help.
When I select my slicer, the "Sort by Column" button is disabled (grey).
And in the "Field"/"Champ" for the slicer, I can only put one object, (the id or the label), not both.
- tarunsinglaSolution Sage
You need to go into the table/data view, click in the column to be sorted, click "sort by column" and then select the surrogate sort column".
So, select your original field in the fields section, and from the modelling tab, choose Sort by column and pick another field (label) to use that field when sorting the original field.
- AlBCommunity Champion
Hi BertrandD
If you have another column with only the labels, you can use that one to sort. Check this out for details:
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column