Forum Discussion
How to use RANKX but filter out one specific customer?
I have a large customer base that are comprised of 5 customer categories. I would like to rank the top 10 customers and include all categories but one. Is there a way to do this using the Rankx expression while totaling up sales for a given time period?
sdmikejr Without knowing any details your Measure should look something like this... :smileyhappy:
Ranking Measure = RANKX ( ALL ( Table[Customer] ), CALCULATE ( SUM ( Table[Sales] ), Table[Category] <> "Category 5" ) )You can of course use your Total Sales Measure above (if you already have one) and then add the filter to it
OR
You can create a Measure to CALCULATE the Total Sales for all except Category 5 and use it in the Ranking Measure
All these should work :smileyhappy:
2 Replies
- NhallquistHelper V
An easier way to accomplish might be to use the Object/Page/Report level filters in PowerBI.
- SeanCommunity Champion
sdmikejr Without knowing any details your Measure should look something like this... :smileyhappy:
Ranking Measure = RANKX ( ALL ( Table[Customer] ), CALCULATE ( SUM ( Table[Sales] ), Table[Category] <> "Category 5" ) )You can of course use your Total Sales Measure above (if you already have one) and then add the filter to it
OR
You can create a Measure to CALCULATE the Total Sales for all except Category 5 and use it in the Ranking Measure
All these should work :smileyhappy: