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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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/

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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