Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello, Is it possible to sort the X axis by two dimensions? In my case I would like to sort the X axis by duration ( as shown ) then by day ( to estimate trend ). If the source data is sorted in this way, it does not translate to the report object. The legend is sorted correctly but not the X axis. Thank you for your help and time.
Solved! Go to Solution.
I've got your question: you want to sort the stacked bar chart by duration then by day.
However, the Stacked bar chart still does not support multi-dimensional sorting now, it is not possible to use both sorting methods at the same time
Maybe you can try this custom sorting:
First, I created a set of sample data:
Then I copied the day column, clicked Enter Data to paste it in, and created a new column to use as a sort marker:
Click Transform data > Merge Queries
Apply & Close
Column tools > (select the day column) Sort by column > Table (3).sort
The result is as follow:
Or you can try R script and create your own stacked bar chart with both sorting methods, these documents may help you:
Run R scripts in Power BI Desktop - Power BI | Microsoft Learn
Create Power BI visuals using R - Power BI | Microsoft Learn
Learn which R packages are supported - Power BI | Microsoft Learn
Best Regards,
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I've got your question: you want to sort the stacked bar chart by duration then by day.
However, the Stacked bar chart still does not support multi-dimensional sorting now, it is not possible to use both sorting methods at the same time
Maybe you can try this custom sorting:
First, I created a set of sample data:
Then I copied the day column, clicked Enter Data to paste it in, and created a new column to use as a sort marker:
Click Transform data > Merge Queries
Apply & Close
Column tools > (select the day column) Sort by column > Table (3).sort
The result is as follow:
Or you can try R script and create your own stacked bar chart with both sorting methods, these documents may help you:
Run R scripts in Power BI Desktop - Power BI | Microsoft Learn
Create Power BI visuals using R - Power BI | Microsoft Learn
Learn which R packages are supported - Power BI | Microsoft Learn
Best Regards,
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please graphically indicate the expected outcome.
Hello Ibendlin, Thank you for the response. Please see the image attached. Hopefully this helps.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
76 | |
52 | |
39 | |
35 |
User | Count |
---|---|
92 | |
67 | |
54 | |
52 | |
46 |