Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
ave several PowerBI charts gauging sentiment amongst our stakeholders, but I can only sort them based on numbers responded. I want the order of the axis to run - Very Good - Good - Remained Same - Poor
How do I reformat / reorder the order of the rows on the bar chart?
Solved! Go to Solution.
Hi @ozziecrobar
1. You can create a conditional column called "Review Sort" on the Power Query level to have the Sort order in place.
2. Go to your Bar graph and sort it based on Review
3. Then go to Data View and Choose the review column and Click Sort By Column -> Review Sort
Thanks,
Proud to be a Super User! | |
Hi @ozziecrobar , assuming that the name of column in Y-Axis is Sentiment.
1- In Power Query Editor, go to "Add Column" > "Custom Column".
2- Name the new column something like SentimentOrder.
3- Paste the code bellow and click OK
if [Sentiment] = "Very Good" then 1
else if [Sentiment] = "Good" then 2
else if [Sentiment] = "Remained Same" then 3
else if [Sentiment] = "Poor" then 4
else 99
Important: Make sure that the created column as Whole Number as DataType.
Close and apply.
Hi @ozziecrobar,
Thank you for reaching out to the Microsoft fabric community forum. Thank you @Nasif_Azam, @grazitti_sapna, @Bibiano_Geraldo, @Jai-Rathinavel, for your inputs on this issue.
After thoroughly reviewing the details you provided, I reproduced the scenario again, and it worked on my end. I used it as sample data and successfully implemented it.
Sort the Category Column by the Sort Column: Now tell Power BI to use this custom order:
outcome:
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hey @ozziecrobar ,
By default Power BI has 2 option to sort a visual and 1 customized option which are:
1. Sort By Number:
2. Sort By Alhapetical Order:
3. Custome Sorting: If you want to sort axis or rows or columns as your need, you have to create a DAX measure to sort things as a custome way.
To reorder the bars on your Power BI bar chart (like in your image) to a custom order such as:
Very Good → Good → Remained the same → Poor
You need to create a custom sorting column and then use that for sorting.
1. Go to Power BI Desktop → Data View.
2. Select your sentiment column, e.g., "SentimentRating" with values like: Very Good, Good, Remained the Same, Poor
3. Create a new column (e.g., "SortOrder") with a sort index:
SortOrder =
SWITCH(
[SentimentRating],
"Very Good", 1,
"Good", 2,
"Remained the Same", 3,
"Poor", 4,
99 // Default if none match
)
4. Select the "SentimentRating" column in the Fields pane.
5. Go to the "Column tools" tab.
6. Click "Sort by Column" → Select "SortOrder".
7. Go back to your bar chart.
8. Use "SentimentRating" on the axis.
If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.
Best Regards,
Nasif Azam
Hi @ozziecrobar
1. Create a Custom Sort Column:
SentimentOrder =
SWITCH(
[Sentiment],
"Very Good", 1,
"Good", 2,
"Remained the Same", 3,
"Poor", 4,
5
)
2. Sort by the New Column:
Go to the Data view in Power BI
Click on your Sentiment column.
Then go to the ribbon and select:
Modeling > Sort by Column > SentimentOrder
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!
Hi @ozziecrobar , assuming that the name of column in Y-Axis is Sentiment.
1- In Power Query Editor, go to "Add Column" > "Custom Column".
2- Name the new column something like SentimentOrder.
3- Paste the code bellow and click OK
if [Sentiment] = "Very Good" then 1
else if [Sentiment] = "Good" then 2
else if [Sentiment] = "Remained Same" then 3
else if [Sentiment] = "Poor" then 4
else 99
Important: Make sure that the created column as Whole Number as DataType.
Close and apply.
Thanks for this, you explained it very clearly and I customised your reponse to my parameters and it worked. Very happy! ( I just now have to apply this to about 20 different barcharts but at least once it is done, it is done!) .
Am now ready to do more epxerimentation with DAX
Hi @ozziecrobar
1. You can create a conditional column called "Review Sort" on the Power Query level to have the Sort order in place.
2. Go to your Bar graph and sort it based on Review
3. Then go to Data View and Choose the review column and Click Sort By Column -> Review Sort
Thanks,
Proud to be a Super User! | |
Create a Sort Order column:
SortOrder =
SWITCH(
'YourTable'[Sentiment],
"Very Good", 1,
"Good", 2,
"Remained the Same", 3,
"Poor", 4
)
Sort the Sentiment column by SortOrder:
In Data view → select Sentiment → click "Sort by Column" → choose SortOrder.
Use Sentiment in the chart – it will now follow your custom order.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 37 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 89 | |
| 73 | |
| 66 | |
| 65 |