cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alim94 Frequent Visitor
Frequent Visitor

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

Accepted Solutions
Super User IV
Super User IV

Re: Change order of columns in a stacked column chart

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
Super User IV
Super User IV

Re: Change order of columns in a stacked column chart

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

alim94 Frequent Visitor
Frequent Visitor

Re: Change order of columns in a stacked column chart

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. 

Community Support Team
Community Support Team

Re: Change order of columns in a stacked column chart

Hi @alim94,

 

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

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
Super User IV
Super User IV

Re: Change order of columns in a stacked column chart

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/
Chelle New Member
New Member

Re: Change order of columns in a stacked column chart

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.

Helpful resources

Announcements
Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors