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
cuongle
Advocate II
Advocate II

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

 

6 REPLIES 6
jdbuchanan71
Super User
Super User

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

 

yo this works

Greg_Deckler
Super User
Super User

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.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

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?

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.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

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.

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.