Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I am very new to powerbi and trying to teach myself, but am unable to do the easiest of things it would seem. 😞
Basically I just want to reorder my legend to show AA, A, B, C, and D.
Any help received gratefully. (In layman terms please as Im not technical at all)
Thanks in advance .
Solved! Go to Solution.
Hi @EmmaLynch
As Power BI doesn't know the order of the legend which is required in your case, to make it display the desired output we have to use the feature called Sort by Column.
So to use it you need to create a table where your Contract class hierarchy resides as follows
Before sorting
After Sorting
To understand the model I have attached the sample file, you can download and apply in the main file
https://drive.google.com/drive/folders/1qpGEP3n954dyFkiIte8kGmjY8wGwt9yI?usp=sharing
Hi @EmmaLynch
As Power BI doesn't know the order of the legend which is required in your case, to make it display the desired output we have to use the feature called Sort by Column.
So to use it you need to create a table where your Contract class hierarchy resides as follows
Before sorting
After Sorting
To understand the model I have attached the sample file, you can download and apply in the main file
https://drive.google.com/drive/folders/1qpGEP3n954dyFkiIte8kGmjY8wGwt9yI?usp=sharing
@EmmaLynch - Use the ellipses (...) on the visual and choose Sort by and then Contract class
Hi,
Thanks for your speedy reply - greatly appreciated.
It was already set to sort by contract class. The contract classes available are AA, A, B, C & D but power BI is sorting them as A, AA, B, C, D.
I need to change this so that it knows AA comes first so the legend will show AA 1st insted of 2nd.
AA =Best
A= 2nd Best
B= 3rd Best
etc.....
Is this possible ?
Hi @EmmaLynch ,
Yes that's how Power Bi will sort them alphabetically.
What you can do is - Give an order to your legend values: (create an ORDER ID column)
AA -->1
A -->2
B -->3
C -->4 and so on.
Then use SORT BY COLUMN functionality in Power BI to sort your Legend column using this Order id column.
Refer tihs article on how to custom sort your column:
https://radacad.com/sort-by-column-in-power-bi
Thanks,
Pragati
Thanks so much for responding......
I added a "Contract Class Order Column" which has populated correctly using the below formula
Then I went back and selected "Contract Class" - clicked Sort by Column icon and selected my new "Contract Class Order Column" and entered. Got error message saying "Sortby another Column - This column cant be sorted by a column that is already sorted, directly or indirectly by this column"
Any ideas ?
Hi @EmmaLynch ,
First thing try tagging the person you are responding to. It's easier to understand.
You are getting this error because your column is alreday sorted by some other column in your data.
Check the following link for a worksround:
https://community.powerbi.com/t5/Desktop/Sort-by-another-column-error/td-p/61341
Thanks,
Pragati
User | Count |
---|---|
141 | |
113 | |
104 | |
78 | |
64 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |