Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

RankX Changes if change sort descending to sort ascending, cannot work out why

I am sorting a table using a Rankx Column, 

When i sort Descending, it works perfectly as below.. 

Ranking is numbered 4 through to 1 descendding.

 

AndrewGriffiths_0-1610622015355.png

 

But when i change the visual to sort Ascending

Ranking starts at 2 and there are two number 2's and no number 1

 

AndrewGriffiths_1-1610622178455.png

The data hasn't changed. 

Any idea why sorting the visual differently causes this? 

I am just changing the visual sort from descending to ascending, no change to filters or measures. 

 

Is this a bug ??

 

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Due to the connection mode and Power BI Desktop version, I cannot access your .pbix file.
Is your formula the same as mine?

v-lionel-msft_0-1610952909965.png

If you cancel the aggregation of the [Units] column, is the sorting result correct?

v-lionel-msft_1-1610953264635.png

 

Best regards,
Lionel Chen

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

5 REPLIES 5
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

Due to the connection mode and Power BI Desktop version, I cannot access your .pbix file.
Is your formula the same as mine?

v-lionel-msft_0-1610952909965.png

If you cancel the aggregation of the [Units] column, is the sorting result correct?

v-lionel-msft_1-1610953264635.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

hello, im having same problem, in my case there is only one table so no relationship issues and no aggregation

please shed some light here,as why it starts from 2?

b0b2c29a-dde3-41d7-9cfa-4c9ccfa3d8c0.png

Anonymous
Not applicable

@Linonel, 

THANK YOU !!

You are right, its the aggregation causing the problem. I moved this from the RANKX to a seperate measure and now it works perfectly. 

Fowmy
Super User
Super User

@Anonymous 

Can you share the measure that you have used for ranking?

Better if you could a sample PBIX file to check further.

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy 

I have discovered that the visual diplays correctly if the data and visual are in the same PBIX. 

When it displays incorrectly is when the data is in one PBIX and the visual is in another PBIX connected via a 'live connection' 

Links to the two files are below:

https://1drv.ms/u/s!AtoYZpsBxPqIhsJuAbYU7VBgpRe_Ng?e=hIksyt

https://1drv.ms/u/s!AtoYZpsBxPqIhsJt7dOyiJniIrDUFQ?e=Zt1y2a

 

I have checked that the DAX query is the same for both. 

 

Thak you, appreciate your help

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.