Reply
Frequent Visitor
Posts: 3
Registered: Thursday

RANKX Help

Hello,

 

I have data sents for a Category, Date, and a Number field. What I want to do is make a Measure to Rank the categories based on the date slicers chosen on the display.  Basically what I need is:

 

Category     Value     Rank

 

And the columns for Value and Rank adjust as I select Days, Months, Years, Etc. So the default view is sum of everything, but then I want to see the ranks for the month of April in 2016, and it shows the totals and the rank of the adjusted totals for that month.

 

So far everything I tried just gives me 1s for everyone's Rank or I get an error.

 

Thank you

Established Member
Posts: 181
Registered: ‎09-19-2016

Re: RANKX Help

Hi @andrewa712,

 

Your rank measure should look something like this:

 

Rank = RANKX(ALLSELECTED(Table[Category]),CALCULATE(sum(Table[Value])))

Doing this you will have a rank based on the selected values from table (slicer of date) and the sum of the value.

 

Please be aware if you place any other field in your table than the Category for making the aggregations your rank will be always 1.

 

Regards,

 

MFelix