cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

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
Community Support
Community Support

Hi @AndrewGriffiths ,

 

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
Community Support
Community Support

Hi @AndrewGriffiths ,

 

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

@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. 

Super User IV
Super User IV

@AndrewGriffiths 

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!

Proud to be a Super User!

Website   YouTube    LinkedIn

@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
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors