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

Rank for particular years

hi i need to show the rank of the countries for praticular years

 

my expreession for rank is

 

Rank = RANKX(ALL('table'[Country]),[Sum_value],,0)

 

i am getting rank for the countries

 

my next step is i want rank for previous year

 

CALCULATE([Rank],FILTER('table','table'[Year]=2012)) 

 

but i am getting 1 for all the countries

 

can any one help on this

 

10 REPLIES 10
arulsettu Frequent Visitor
Frequent Visitor

Re: Rank for particular years

any idea guys ?

Re: Rank for particular years

Hi

 

  Can you share some sample data and how you want to get the result?

 

Just to say in general, you can get rank for country and year as a separate column.

Rank.png

 

 

arulsettu Frequent Visitor
Frequent Visitor

Re: Rank for particular years

i created everything as measure. do you wanr me to create as column

Re: Rank for particular years

Hi

 

Are you ok with the given format? If that is fine then you can replicate the same and get the result.

 

Thanks

Hari

arulsettu Frequent Visitor
Frequent Visitor

Re: Rank for particular years

This is my script for column

 

Rank_dimension = RANKX(ALL('table'[Country]),[Sum_value],,0)

 

for this i am getting below output

 

Capture.JPGrank output

 

my year like this

2011

2012

2013

2014

 

its in whole number data type

 

arulsettu Frequent Visitor
Frequent Visitor

Re: Rank for particular years

i created like the image you posted 

 

Rank_dimension = RANKX(ALL('table'[Country]),'table'[Country])

 

iam getting the different ranks. upto this fine

 

now i need the rank for 2 years

 

example 2016 and 2012

 

2012_rank = CALCULATE(SUM([Rank_dimension]),FILTER('table','table'[Year]=2012))

 

2016_rank = CALCULATE(SUM([Rank_dimension]),FILTER('table','table'[Year]=2016))

 

 i am getting same rank for both years

 

can you suggest me how to approach this issue

 

thanks

Re: Rank for particular years

Hi

 

  It might the same number of rows for both the Year. 

 

 In the below screenshot, if you take the Rank_dimension, it has the same number of values because it has same 4 entries. In case if you have a different number of rows then you will get different values.

 

Rank1.png

 To show that, I created another 2 column 2012Yr & 2013Yr with RankYear column and it shows 4 & 8 values.

 

 

arulsettu Frequent Visitor
Frequent Visitor

Re: Rank for particular years

Thanks for the reply

 

but i have different values for 2012 and 2016

 

even getting same rank

 

can you please explain how its defininig the rank

 

Rankx(All(table[country],table[copuntry]))

 

here we are not passing any values right. how its bringing the rank

 

and why i am getting same rank

 

Thanks

arulsettu Frequent Visitor
Frequent Visitor

Re: Rank for particular years

This is the output i am getting

 

Capture.JPG

 

can you see china has different values for 2016 and 2017 but getting same rank

 

can you help me on this

 

 

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 116 members 1,764 guests
Please welcome our newest community members: