The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all,
I guess my requirement is simple but not able to get through.
I have a line chart with years added in the legend and months added in X axis. the legend currently shows 2018, 2019, 2020.
I would like to get the legend in reverse order like 2020, 2019, 2018. any thoughts please....
Solved! Go to Solution.
@LP2803 , Create a desc Rank on year and mark it as sort column
New columns
Year 1 = [Year]
Year Rank = Rankx(all(Table), [Year],,desc,dense)
sort Year 1 on Year rank and use year 1
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
@LP2803 , Create a desc Rank on year and mark it as sort column
New columns
Year 1 = [Year]
Year Rank = Rankx(all(Table), [Year],,desc,dense)
sort Year 1 on Year rank and use year 1
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
I get an error "a circular dependency was detected: "
Ok. when i use the column name instead of the Table in All(table) i get the result.
But i have new issue now. when i go to modeling click on sort by column it show the below error. How can i fix this.
Sort by another column
This column can't be sorted by a column that is already sorted, directly or indirectly, by thi column.
Got it!
I derived the Year1 column from a different data field and then the sorting worked.
Thanks a lot. It is a great help.
This should work for you
https://community.powerbi.com/t5/Desktop/Modify-the-legend-order/m-p/25338#M8261
Proud to be a Super User!
Thanks for the reply.
I cant create different measure as its not suitable in my case.
for the second solution provided as below, i dont find any arrow or field in the legend pane. as mentioned in the step two below.
Could you please add a picture or screenshot where i can find it?
1) Select your visual.
2) In the Legend pane, select the arrow next to the field that you want to reorder.
3) Select New Group.
4) Create a name for your group (Power BI will populate one by default).
5) Use the group dialogue to create a separate group for each attribute value that you want to appear separately in the visual. You can group attribute values or keep them separate by creating a group for each one. There's also a handy "Include Other group" option that groups any remaining attribute values into an "Other" category if you don't need them broken out.
6) Since Power BI orders the legend alphabetically, if you rename the groups and place a number in front of each one indicating the order in which you want it to appear ("1)" or "1-" or "1:" for example), Power BI will display the groups in ascending order based on the leading digit.
Power BI also allows you to reuse the grouping you created in other visuals. It's a really handy way to reorder the attributes if you don't mind there being a number in front of each item in your legend.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
247 | |
122 | |
110 | |
77 | |
72 |