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

Sorting by column not working on per country and brand rank basis

Hi all,

 

Hope you guys are doing well. I was having a problem when I try to sort Brand Name by Actual Rank. But its giving me this error:

 

Screenshot (111).png

 

Capture.PNG

Each brand has different but unique rank values based on Country and Brand Name combination but I am of the opinion that using a country filter should allow me to sort Brand Name using Actual Rank. I am working with a matrix because of client requirements so using a table is out of the question. I have attached both the sample excel file and pbix with this post. 

 

Excel Data: https://1drv.ms/x/s!AjhtAEoJ85hKpVh-276QtLP_NbBL?e=dUJXQN

PBIX File: https://1drv.ms/u/s!AjhtAEoJ85hKpVlVXjWpH1B-MeXF?e=inVnIK

 

Any help regarding will be much appreciated.

Thanks.

1 ACCEPTED SOLUTION

no sort only takes the 2 columns into consideration nothing else. what you could do is create a composite column with rank and country and then try sort by that. if its unique it will work, but it might have performance issues if you have a lot of data, so ie concatenate rank and country into a separate field and see if that will work, not sure if there will be issues due to the calculation of rank. but give it a bash





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
vanessafvg
Super User
Super User

the issue is that your actual rank has duplications over brand, in order to use it to sort you must have unique values that map to brand uniquely, it can't do it on two columns




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Thanks for the answer @vanessafvg One thing... Does sort by column not take the filter context of country into account? Like country is included in the slicer, shouldn't it filter by country and then sort Brand Name by Actual Rank column accordingly?

no sort only takes the 2 columns into consideration nothing else. what you could do is create a composite column with rank and country and then try sort by that. if its unique it will work, but it might have performance issues if you have a lot of data, so ie concatenate rank and country into a separate field and see if that will work, not sure if there will be issues due to the calculation of rank. but give it a bash





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




amitchandak
Super User
Super User

@commonsenseuser ,  Make you have non overlapping rank

Break ties

https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/

 

Also,You can sort a column on a column.

 

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.