Forum Discussion

mfinlay's avatar
mfinlay
Icon for Advocate II rankAdvocate II
6 years ago

RANKX with alternate sort

Hi Power BI Gurus,

 

I have a transaction-level fact table linked to a dim_date table.

 

I'd like to show an aggregate of income by month, and also a rank of the months by income. However, I'd like to have the table ordered by calendar month.

 

I can easily achieve the ranking, or the sorting - but I can't get them to work together. Eg this Rankx function works:

 

 

 

Rank Value =
RANKX ( ALL ( 'Entry Date'[Period Name] ), [MyVal] )

 

 

 

To give:

However, I want to show the table ranked by month in chronological order. If I try to apply an alternate sort in the Data tab

 

 

 

this works, but ruins the rank:

 

 

Can anyone advise how I can get what I need?

 

thanks

Matt

4 Replies