Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The 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.

Reply
Rnaval
Helper V
Helper V

Is there a way to rearrange the bars in a bar chart

Here's the Bar Chart which I would like to rearrange to instead show in the following order.

 

Critical

High

Medium

Low

 

Rnaval_0-1738912852797.png

 

3 ACCEPTED SOLUTIONS
wini_R
Solution Supplier
Solution Supplier

Hi @Rnaval,

 

You would need an additional column with sort order or a table similar to the one below to do that

wini_R_0-1738913631769.png

 

Then you need to sort your severity column by that order column as described in this article:
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column

 

As the last step please make sure to sort the visual by the dimension and not the measure:

wini_R_1-1738913839112.png

 

View solution in original post

v-fenling-msft
Community Support
Community Support

Hi, @Rnaval 

I am glad to help you.

 

First click on Transform data, in the Power Query Editor you can add a new column to customize the sort order:

vfenlingmsft_0-1739153836013.png

 

vfenlingmsft_1-1739153896521.png

 

vfenlingmsft_2-1739153921607.png

 


Close & Apply.


Then select the Serverity field in the Table view and click Sort by column, select the column you just added:

vfenlingmsft_3-1739153966827.png

 

vfenlingmsft_4-1739154018496.png

 

I have attached the pbix file for this simple example below, hope it helps.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

wini_R
Solution Supplier
Solution Supplier

15 REPLIES 15
v-fenling-msft
Community Support
Community Support

Hi, @Rnaval 

I am glad to help you.

 

First click on Transform data, in the Power Query Editor you can add a new column to customize the sort order:

vfenlingmsft_0-1739153836013.png

 

vfenlingmsft_1-1739153896521.png

 

vfenlingmsft_2-1739153921607.png

 


Close & Apply.


Then select the Serverity field in the Table view and click Sort by column, select the column you just added:

vfenlingmsft_3-1739153966827.png

 

vfenlingmsft_4-1739154018496.png

 

I have attached the pbix file for this simple example below, hope it helps.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For some reason it is not working for me, I'm attaching my data and pbix file so you can please have a look.

wini_R
Solution Supplier
Solution Supplier

Hey @Rnaval,

I have applied the steps we suggested here and it works fine:

wini_R_0-1739299585733.png

 

pbix file: https://www.dropbox.com/scl/fi/jnm53o11y3cre4uoymxjt/VM_pbiForum.pbix?rlkey=fulxo4afiz6rdp9ey668lzai...

Just a quick question, is there a way for me to format the total counts with a thousand separator? Meaning a comma if the number is in the thousands?

wini_R
Solution Supplier
Solution Supplier

Sure, just select your measure in Data pane and click comma seperator symbol in the top menu:

wini_R_0-1739356777682.png

 

How do I access the menu you are showing? I don't see it.

wini_R
Solution Supplier
Solution Supplier

wini_R_0-1739370999776.png

You need to select a related measure in Data pane first (1), then it switches to Measure tools tab (2) automatically. Last step it to apply the formatting you want (3)

Ok Thanks that worked for this chart but not for the chart next to it, any suggestions?

wini_R
Solution Supplier
Solution Supplier

The other chart does not include that same measure, actually it just includes a column. I'd suggest to create a measure and format it accordingly.

Great Thanks

Thank you very much, it's exactly the way I wanted it to look. 

 

Question - did you create a new table? Severity and Severity Order field, Is that a physical table in one of the spreadsheets or a logical table?

wini_R
Solution Supplier
Solution Supplier

I've created a (physical) helper table directly in semantic model (using Enter data method) which includes all the distinct values from Severity column and also added the sort order column, exactly same table as mentioned in my initial message

Thank you

wini_R
Solution Supplier
Solution Supplier

Hi @Rnaval,

 

You would need an additional column with sort order or a table similar to the one below to do that

wini_R_0-1738913631769.png

 

Then you need to sort your severity column by that order column as described in this article:
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-sort-by-column

 

As the last step please make sure to sort the visual by the dimension and not the measure:

wini_R_1-1738913839112.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors