cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

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

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Re-stacking "line and stacked column" chart categories

Hi , @spenot09 

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

Re: Re-stacking "line and stacked column" chart categories

@spenot09 ,

refer if this can help

https://www.seerinteractive.com/blog/reorder-powerbi-legend/



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Re: Re-stacking "line and stacked column" chart categories

Hi, @spenot09 

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

 

Highlighted
Helper IV
Helper IV

Re: Re-stacking "line and stacked column" chart categories

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?

Highlighted
Community Support
Community Support

Re: Re-stacking "line and stacked column" chart categories

Hi , @spenot09 

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

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors