Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
if i place max(sales) in x-axis and customer name into yaxis and orderyear into legend in bar chart of power bi im not able to sort the visual its giving random sort
i have tried making with orders table of sample superstore suggestions please
Solved! Go to Solution.
Hi @raju8004212 -yes, this is a known limitation with Power BI. Power BI cannot sort by a measure across all legend categories. If you want to still use the legend (e.g. Order Year), then create a ranking measure per customer based on total or max sales, and use that to sort your Y-axis (Customer Name).
create as like
Customer Rank =
RANKX(
ALL('Orders'[Customer Name]),
CALCULATE(MAX('Orders'[Sales]))
)
Then go to your Customer Name column, and in the Modeling tab, set "Sort by Column" = [Customer Rank].
Now your Y-axis (Customer Name) will sort according to max sales despite the legend.
solved reference links:
Stacked bar chart won't sort properly with value i... - Microsoft Fabric Community
Hope this helps.
Proud to be a Super User! | |
Hi @raju8004212 ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.
Hi @raju8004212 ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.
Hi @raju8004212 ,
We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.
Hi @raju8004212 -yes, this is a known limitation with Power BI. Power BI cannot sort by a measure across all legend categories. If you want to still use the legend (e.g. Order Year), then create a ranking measure per customer based on total or max sales, and use that to sort your Y-axis (Customer Name).
create as like
Customer Rank =
RANKX(
ALL('Orders'[Customer Name]),
CALCULATE(MAX('Orders'[Sales]))
)
Then go to your Customer Name column, and in the Modeling tab, set "Sort by Column" = [Customer Rank].
Now your Y-axis (Customer Name) will sort according to max sales despite the legend.
solved reference links:
Stacked bar chart won't sort properly with value i... - Microsoft Fabric Community
Hope this helps.
Proud to be a Super User! | |
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 45 | |
| 38 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 86 | |
| 69 | |
| 38 | |
| 29 | |
| 26 |