Dynamically Rank rows in PivotTable based on a measure and the current context.
-
Thursday, August 02, 2012 12:11 AM
Hi Guys,
I'm basically trying to write a DAX measure that replicates the good old Excel 'Rank' function whereby you rank a given number by the column that its in.
I have a measure [Loyalty Conversion] which represents the number of potential customers converted to out loyalty programme and I have a bunch of different reports that measure this across a number of dimensions such as stores, regions, dates etc. My inital attempt has invlved running the measure through the RANKX function:
=RANKX(ALL('Store Attributes'[Store]),[Loyalty Conversion])
The issue I have is that as things stand not only do I have to hard code the column into the measure but the thing fundamentally doesn't work if I want to only show a subset of the dimension in question (because the 'All' opens up the whole thing). I need to ensure that the measure takes into account the current context of the PivotTable.
Any ideas?
Jacob
All Replies
-
Monday, August 06, 2012 11:15 AM
Check this thread, it may help you: Displaying Rank Dynamically irrespective of dimension selection using MDX Calculated measure- Proposed As Answer by Elvis LongMicrosoft Contingent Staff, Moderator Saturday, August 11, 2012 7:50 AM
- Marked As Answer by Elvis LongMicrosoft Contingent Staff, Moderator Tuesday, August 14, 2012 11:22 AM
-
Tuesday, August 07, 2012 7:38 AM
Thanks Irusul - will check it out.
Jacob

