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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Change order of columns in a stacked column chart

Hi, 

 

In a stacked column chart, I'm trying to change the order that the columns are displayed in. The labels are in text format because they are categories. I've tried sorting them by ascending and descending, but for some reason, the 6-12 category is recognized as the highest value. Anyway to change this so that it lists 0-6, 6-12, 12-24, and 24+?

 

Thank you, 

 

 

Capture.PNG

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

  1. Create a seperate 2 column Table - Category and Order of Category.  The Order of Category column will have numbers from 1 to 4.  Name this Table as Category_order
  2. Create a relationship from the Category column of your base data Table to the Category column of your new Table
  3. In the base data Table, write this calculated column formula and name the column as Order

=RELATED(Category_order[Order])

 

  1. Click on any cell in the Category column of your base data table and go to Home > Sort by Column > Order
  2. In your visual, drag the Category field from the base data Table

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

  1. Create a seperate 2 column Table - Category and Order of Category.  The Order of Category column will have numbers from 1 to 4.  Name this Table as Category_order
  2. Create a relationship from the Category column of your base data Table to the Category column of your new Table
  3. In the base data Table, write this calculated column formula and name the column as Order

=RELATED(Category_order[Order])

 

  1. Click on any cell in the Category column of your base data table and go to Home > Sort by Column > Order
  2. In your visual, drag the Category field from the base data Table

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

When I select 'Create Column' in the Calculations tab, the new column appears and then disappears in the table where I'm trying to add it.  Help.

Anonymous
Not applicable

Hi Ashish, 

 

When I try to create a relationship between my base data column and the new category column, it says that i can't create a relationship because one of the columns must have unique values. 

Hi,

 

In the Category_Order Table, there should only be unique entries in the Category column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi @Anonymous,

 

You can try to create a calculated table with unique value as bridge table to link these tables.

 

Sample:

Bridge Table =
DISTINCT (
    UNION ( VALUES ( Table1[ColumnName] ), VALUES ( Table2[ColumnName] ) )
)

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.