Forum Discussion

Maikeru's avatar
Maikeru
Helper II
6 years ago
Solved

RANKX with condition

Hi,

 

I am trying to create a RANKX measure on customers meeting a certain revenue conditions.

 

 

Rank top 100 = 
VAR Customer_list = 
FILTER(
ALLSELECTED(Revenue[Customer]), 
[Revenue total] < 50000000 && [Revenue total] > 30000000
)

VAR RANK_DESC = 
RANKX(
FILTER(ALLSELECTED(Revenue[Customer]), Revenue[Customer] IN Customer_list),
[Revenue total],
,
DESC)

RETURN
IF (ISINSCOPE(Revenue[Customer]),
IF(RANK_DESC <= 100, RANK_DESC, BLANK()),
BLANK()
)

 

 

 

However the measure would still evaluate customers which do not meet the criteria.

The dataset is a standard sales transactional table: date, customer, revenue.

 

Any ideas would be appreciated.

 

Best regards.

 

5 Replies