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

Re-stacking "line and stacked column" chart categories

Hello! I am looking to reorder the categories within the columns of a combo chart. I would like the visual below: 

nOT gOOD.JPG

to look more like the visual below here:

zx.JPG

 

Where all the grey categories are at the bottom in the same order. I don't really care about the ordering of the coloured categories. Is this possibe to rearrange the categories in such a way? In my top visual the location of the grey block changes in June/July is because they are actually different categories to the previous months, I just have the same colour assigned to them.

 

My set-up is as follows:

sett.JPG

 

Thank you for any help!

 
1 ACCEPTED SOLUTION

Hi , @Anonymous 

Instead of entering a table, you can use dax  to create a a dynamic sort table:

 

Order 1 = DISTINCT(Table1[Country])

 

Create a custom  rand sort order :

 

rand sort column  = RAND()

 

Then select the field ("Country") and make it sort by cloumn " rand sort order.

 

In addition,you also can take a try to create a calculate column "Ranking" ( Here I rank  the countries by total of COGS)

 

Ranking = RANKX('Table1',SUMX(FILTER('Table1','Table1'[Country]=EARLIER(Table1[Country])),'Table1'[COGS]),,DESC,Dense)

 

Then you can use formala to create a sort table:

 

Order 2 = SUMMARIZE(Table1,Table1[Country],Table1[Ranking])

 

84.png

PBIX ATTACHED

 

Best Regards,
Community Support Team _ Eason
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

4 REPLIES 4
v-easonf-msft
Community Support
Community Support

Hi, @Anonymous 

It  is suggest to create a seperate table with a index column and establish a relationship  between seperate table and the original table:

39.png

Then select the field ("Country") and make it sort by cloumn "index"

40.png

The result of the comparison is as follows:

41.png

pbix attached

 

Best Regards,
Community Support Team _ Eason

 

Anonymous
Not applicable

Hi @v-easonf-msft thank you for your reply. However, in my case the categories could change over time. So creating such a table would be difficult to account for new categories being entered?

Hi , @Anonymous 

Instead of entering a table, you can use dax  to create a a dynamic sort table:

 

Order 1 = DISTINCT(Table1[Country])

 

Create a custom  rand sort order :

 

rand sort column  = RAND()

 

Then select the field ("Country") and make it sort by cloumn " rand sort order.

 

In addition,you also can take a try to create a calculate column "Ranking" ( Here I rank  the countries by total of COGS)

 

Ranking = RANKX('Table1',SUMX(FILTER('Table1','Table1'[Country]=EARLIER(Table1[Country])),'Table1'[COGS]),,DESC,Dense)

 

Then you can use formala to create a sort table:

 

Order 2 = SUMMARIZE(Table1,Table1[Country],Table1[Ranking])

 

84.png

PBIX ATTACHED

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

amitchandak
Super User
Super User

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.