question on RANKX

XLBob

Board Regular
Joined
Aug 17, 2012
Messages
65
I have sales data at monthly level and you can find it on my onedrive. The file name is "sample" and below is the link.
https://onedrive.live.com/?id=7DF5E31C189063EC%21124&cid=7DF5E31C189063EC

How do I add a calculated column to rank each category for the same month and channel? For example, rank all category for the month of Nov 2015 in channel CH4.
Then for each category I want to rank the subcategory and keep the top 5 as it is and combine the rest into a new subcategory called "other". For example, in Nov 2015 and channel CH4, category with ranking 2 has x (x>10)subcategories, rank these subcategories and for the subcategory with ranking from 6 to x combine them into a new subcategory called "other'.

Due to the merge as mentioned above I guess it has to be done with calculated columns instead of measures

Thanks for your help.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Sorry; I didn't realise that RANKX was a DAX function. Best of luck.
 
Upvote 0
Sorry; I didn't realise that RANKX was a DAX function. Best of luck.

I have managed to come up with a solution using Calculate and Allexcept. What I am trying to achieve in the end is to have 5 pie charts for the top 5 category, then for each pie chart, it has 6 pieces for the top 5 subcategory and "other" which is the group of other subcategory. Because at the moment, Power BI desktop does not have support "Top X" filter which excel does, so I have to use calculated column to find the ranking and add a new subcategory column. I hope someone can have a better or more elegant solution. I will come back to share if I have one, just need more time to think about this.
 
Upvote 0

Forum statistics

Threads
1,214,825
Messages
6,121,787
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top