cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cuongle Member
Member

Sort Column Chart based on column which is not included into visual

Assume I have column chart with:

 

1. Name: on Axis field.

2. PaymentDayDiff on Value field.

 

But I want to sort the columns chart based on another column call `Spend` which is not available on Sort dropdown (because `spend` is not included into `Axis` or `Value`)

 

How can I do this?

 

 

 

Capture.PNG

 

5 REPLIES 5
Super User
Super User

Re: Sort Column Chart based on column which is not included into visual

In Desktop, you can go into your model, choose your column and set the "Sort By" column. 5th button from the left on the Modeling tab of the ribbon.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

cuongle Member
Member

Re: Sort Column Chart based on column which is not included into visual

Thanks for your answer, but I am afraid that it does not work, the reason might be I did filter and select top n (use RANKX) for this column chart?

Super User
Super User

Re: Sort Column Chart based on column which is not included into visual

Hmm, are you getting any error or are you setting the Sort By column and the visual is not honoring it?

 

I have run into an issue using FIRSTDATE on a custom column and then trying to use it as a Sort By column and received an error that I was not allowed to do that. That's the only time I have had this not work.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

greggyb New Contributor
New Contributor

Re: Sort Column Chart based on column which is not included into visual

In general, it's suggested that the sort-by column have a 1:1 relationship with the sorted column, e.g. MonthNumber sorts MonthName, each with 12 distinct values.

 

Strictly, sort-by:sorted must be 1:1 or 1:N. In the 1:N case, the sorted column will have an order associated with sort-by, but will be sorted by its own value within the groups defined by sort-by.

E.g. Sorting MonthName by QuarterNumber will give you
February

January

March

April
June

May

August

July

September

December

November

October

 

This is the display in a table. All of Q1's months are grouped together, but since they are tied on their sort-by number, the tie is broken by sorting on MonthName's own value within that quarter.

 

N:1 sort-by:sorted will throw an error.

Super User
Super User

Re: Sort Column Chart based on column which is not included into visual

This topic came up first in my search so I though I would reply with an answer.  If you add a measure to the tooltip of a visual, it is not displayed but you can sort by it.  Thanks to GuyInACube for the video.

https://www.youtube.com/watch?v=1bp_e-ik7aA

 

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 277 members 3,172 guests
Please welcome our newest community members: