Forum Discussion
Stemar_Aubert
6 years agoResolver I
Exclude items from RANKX evaluation and
Hello, I am trying to rank the performance of my Districts based on their YoY Growth using RANKX(). Current formula, where Custom is a flag to exclude specific districts: if(
ha...
- 6 years ago
Sorry, my bad, FILTER can only accept one-two arguments, try the below instead.
VAR _search = "OTHER" VAR _tbl = CALCULATETABLE( FILTER( ALLSELECTED( Local[DISTRICT] ), SEARCH( _search, Local[DISTRICT], 1, 0 ) = 0 ), Local[Custom] = 0 ) RETURN IF( SEARCH( _search, SELECTEDVALUE( Local[DISTRICT] ), 1, 0 ) = 0, RANKX( _tbl, [PINS YTD YoY Δ] ) )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
Mariusz
6 years agoCommunity Champion
Sure, try something like below.
VAR _search = "OTHER"
VAR _tbl =
FILTER(
ALLSELECTED( Local[DISTRICT] ),
SEARCH( _search, Local[DISTRICT], 1, 0 ) = 0,
Local[Custom] = 0
)
RETURN
IF(
SEARCH( _search, SELECTEDVALUE( Local[DISTRICT] ), 1, 0 ) = 0,
RANKX( _tbl, [PINS YTD YoY Δ] )
)
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.

Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
Stemar_Aubert
6 years agoResolver I
Hi Mariusz ,
thank you for helping. So what you do is create two variables, one that search valid districts, and one that ranks the PINS YTD YoY Δ based on a table of valid districts ?
However, I have a slight issue, Filter refuses to accept the Local[Custom] = 0 argument. Is it needed since you have already the Search function looking for 0 ?
Thanks,