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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

4 REPLIES 4
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.

 

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors