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 not giving correct result when data is filtered yearwise

Hello Experts,

 

I am having a table as below- 

 

Site      Year    Result

A          2014     5

A         2015      6

B         2014      3

B         2015      7

C         2014     3

C         2015     2

D         2014     1

D          2015     4

 

I am trying to derive the overall and yearwise ranks for the sites based on results. I am getting the correct result for overall ranks, however when i try apply the year filter, the ranks shows the wrong value.

 

I am using below dax for the same-

 

Site Ranks  = Rankx (ALL( Data[Site]), Calculate(Average(Data[Result]),ALLEXCEPT(Data,Data[Year],Data[Site])),,ASC,Skip.

 

Can you please help me to get the yearwise correct ranks for the same??

 

1 ACCEPTED SOLUTION
lc_finance
Solution Sage
Solution Sage

Hi @Anonymous ,

 

I tried to recreate the same model as you. It works for me when I filter by year (by adding the years to my table) and shows the ranking.

 

Can you explain more about your problem?

 

Regards,

 

LC

 

Screenshot 2019-10-13 at 12.13.39 AM.png

View solution in original post

3 REPLIES 3
lc_finance
Solution Sage
Solution Sage

Hi @Anonymous ,

 

I tried to recreate the same model as you. It works for me when I filter by year (by adding the years to my table) and shows the ranking.

 

Can you explain more about your problem?

 

Regards,

 

LC

 

Screenshot 2019-10-13 at 12.13.39 AM.png

Anonymous
Not applicable

Hi @lc_finance ,

 

Thanks for your help!! This works fine at my end..

No problem!

 

Glad it helped,

 

 

LC

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