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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
bdehning
Post Prodigy
Post Prodigy

Clustered Bar Chart or Stacked Bar Chart Sorting Ascending or Descending

I have a Clustered Bar Chart that no longer allows me to sort accending or decending properly.    I use a Y Axis Conditional Column which is what I want to sort by.      The X-Axis is a Count field and I can sort just fine accending or decending with that. 

 

I did not make any changes to the columns or fields used in the chart visual, but if I try to sort on the Conditional Column not the order is all jumbled up like below.  Under the bad sort is image from my other file where it works.  

 

I am not sure what may be the problem?

 

Tenure Bad.PNG

 

Tenure Good.PNG

 

   

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @bdehning ,

 

That is because the data type of your y axis field data is text. Thus, it is sorting alphebically.  Sort by column will help you. If you wish a column to be sorted by values of another column you can simply do that in the Data tab of Power BI Desktop. First go to Data Tab, Select the field that you want to be sorted , and then from the menu option under Modeling choose Sort Column By, and select the field that contains numeric values.

 

For more details, please refer to:

Sort By Column in Power BI - RADACAD

 

Best Regards,

Jianbo Li

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

7 REPLIES 7
v-jianboli-msft
Community Support
Community Support

Hi @bdehning ,

 

That is because the data type of your y axis field data is text. Thus, it is sorting alphebically.  Sort by column will help you. If you wish a column to be sorted by values of another column you can simply do that in the Data tab of Power BI Desktop. First go to Data Tab, Select the field that you want to be sorted , and then from the menu option under Modeling choose Sort Column By, and select the field that contains numeric values.

 

For more details, please refer to:

Sort By Column in Power BI - RADACAD

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bdehning
Post Prodigy
Post Prodigy

I think my current Conditional Column is sorting alphebically and not numerically?  How do I correct that?

bdehning
Post Prodigy
Post Prodigy

Do I need to Join the Table I create with my main data table?

v-jianboli-msft
Community Support
Community Support

Hi @bdehning ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_5-1666597107853.png

 

Please try:

First, Add an index column in Power Query

vjianbolimsft_1-1666596892947.png

Then Sort by Index Column:

vjianbolimsft_2-1666597003532.png

Then Sort the visual by Y axis:

vjianbolimsft_3-1666597050068.png

Final output:

vjianbolimsft_4-1666597081872.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bdehning
Post Prodigy
Post Prodigy

After some testing, it seems that connecting my file to a server is when the ASC and DESC stopping working correctly for the page and visual shown above.  How would connecting the file to a server, affect the Sort order?  

bdehning
Post Prodigy
Post Prodigy

For some reason, the Asc and Desc sort works fine by value but no longer by Axis?    Frustrating

amitchandak
Super User
Super User

@bdehning , For X-axis, There is sort option, you can sort on axis or value and asc or desc.

 

For Legend more option added in oct -2022 update

https://powerbi.microsoft.com/en-us/blog/power-bi-october-2022-feature-summary/#post-21148-_Toc11605...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.